1
當我運行它時沒有輸出到這個腳本。我認爲它很明顯,但是它創建了test.txt,但沒有數據放入它刪除的文件中!沒有輸出Powershell腳本
在此先感謝
$limit = (Get-Date).AddDays(-7)
Get-ChildItem 'C:\temp' -Recurse |
Where-Object {
-not $_.PSIsContainer -and $_.CreationTime -lt $limit
} | Remove-Item | Out-File -FilePath c:\text.txt