我在同一路徑中有一個 zip 檔案夾和普通檔案夾。我只需要從該路徑中洗掉 zip 檔案夾

我嘗試使用這個腳本:
$TestPath='D:\RAW\St\Documentum\2021-10-12\VPA_IMAGES'
Get-ChildItem -Filter *.zip | `
ForEach-Object { if ($TestPath $_.BaseName) {
Remove-Item -Recurse -Force $_.BaseName }
}
它不會洗掉該 zip 檔案夾。我怎樣才能洗掉那個 zip 檔案夾?
uj5u.com熱心網友回復:
$TestPath='E:\testing'
Get-ChildItem -Path $TestPath -Filter '*.zip' | Remove-Item

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/316451.html
標籤:电源外壳
