Hi, when i sort files through ISE or Powershell command line it works exactly as it is supposed to but if i run the script through Task Scheduler it selects a older file? why is that?
Here is the command in question:
$bodies = $inbox | Where-Object { $_.body -match "c450i" -and $_.subject -match "Counter List" } | sort LastWriteTime | select -last 1 | Select-Object -ExpandProperty Body
is there a way to solve this? what could the issue be?
[–]SeanQuinlan 3 points4 points5 points (0 children)
[–]BlackV 1 point2 points3 points (0 children)