1
這是我的PowerShell腳本:刪除,項目不能刪除文件
$dir = ([io.fileinfo]$MyInvocation.MyCommand.Definition).DirectoryName
Get-ChildItem -Path .\ -Filter *.png -Recurse -File | Where-Object {$_.Name -match ".+[\]]+.png"} | ForEach-Object {
echo $_.FullName $(Test-Path $_.FullName)
Remove-Item $_
echo $_.FullName $(Test-Path $_.FullName)
}
的回聲,給實際的文件名,但測試的路徑解析爲false,並沒有什麼徹底刪除。
哦,這是有道理的!非常感謝。它現在有效! –