I must process all directories older than x days . This test-statement is ok:
Get-Childitem -path $InputPath -recurse | where-object { $_.LastWriteTime -lt (get-date).adddays(-7) -and $_.PSIsContainer } | Out-GridView
In the script I want all directory names in $srcDir for further processing.
$srcDir = Get-Childitem -path $InputPath -recurse | where-object { $_.LastWriteTime -lt (get-date).adddays(-7) -and $_.PSIsContainer }
using this statement in the script I get a runtime-error. The where-object is missing an "and" parameter ???
Can pls. anyone help me what's wrong with this statement?
sonny
Siegmund Sonntag