powershell - 使用 powershell 删除 zip 文件夹
问题描述
我在同一路径中有一个 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 文件夹?
解决方案
推荐阅读
- postgresql - 为什么 Postgresql pgadmin 中强调密码?
- azure - Spark Cosmos db 连接器正在删除大多数行为空的列
- tcl - Tcl - 从标准输入读取字符而无需在 Tcl 中按 enter
- api - Stocktwits API 不工作,错误是“此页面不工作”
- amazon-web-services - 如何使用 AWS CLI 仅列出 AWS 组织下的帐号和账户名称
- javascript - 反应没有为相同的 URL 获取不同的图像
- c# - EF Core 6 派生的 DbContext 未从 Startup 获取连接字符串
- python - python从元组列表中删除tup [0]重复项
- visual-studio-code - (vs代码)杀死终端按钮消失了
- java - 为什么在尝试运行 JavaFX 项目时应用程序启动方法出现异常?