0
无法使此命令正常工作。我试图在昨天下午5点以后创建的名称中看到所有具有特定字符串的文件,无论我今天什么时候运行脚本。以下是我到目前为止。任何帮助将不胜感激。如何列出昨天下午5:00以来创建的文件?
$today = (get-date).dayofyear
$string = "blah"
$filepath = "C:\files"
Get-ChildItem -Recurse -Force $filePath | where { $_.CreationTime.dayofyear -eq (($today)-1) } -and { $_.CreationTime.hour -ge 17 | Where-Object { ($_.PSIsContainer -eq $false) -and ($_.Name -like "*$string*"}
这很好。非常感谢。 –