Hello,
I have a script to select the oldest file form $srcdatapath folder:
$oldFile = Get-ChildItem -Path $srcDataPath | Sort-Object -Property LastWriteTime | Select-Object -First 1
Then I need to select all files with LastWriteTime at the same date from the same path:
if($oldFile) { $oldFilesDay = Get-ChildItem -Path $srcDataPath | Where-Object { $_.LastWriteTime.Date -eq $oldFile.LastWriteTime.Date }It gaves me no record and debug displays an error:
The scope number '1' exceeds the number of active scopes.Parameter name: scopeIDActual value was 1.
Could you advise how to push the variable to pipeline?
Thanks