简体   繁体   中英

Deleting the zip folder using powershell

I have a zip folder and normal folder in same path. I need to delete the zip folder only from that path

在此处输入图像描述

I tried using this script:

$TestPath='D:\RAW\St\Documentum\2021-10-12\VPA_IMAGES'
Get-ChildItem -Filter *.zip | `
  ForEach-Object { if ($TestPath $_.BaseName) {
    Remove-Item -Recurse -Force $_.BaseName }
  }

It is not removing that zip folder. How can I delete that zip folder?

$TestPath='E:\testing'
Get-ChildItem -Path $TestPath -Filter '*.zip' | Remove-Item
  

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM