I have a Script that goes like this:
$var = Get-ChildItem C:\Temp\ -Name "_*.txt" | Sort-Object -Property Name
foreach ($item in $var){
do stuff
}
The Problem with this is, the script doesnt start at the top of the Array.
It is nessesary for it to start at the top, because it Imports files and has to get the latest last.
Can anyone help me solve this Problem please?
foreach loop randomizes sort-object list
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.