powershell - 删除所有 .ica 文件

标签 powershell powershell-2.0

我尝试了几种不同的方法,但仍然无法正常工作。

remove-item .\*\appdata\local\temp\* -Include *.ica

我希望它删除用户临时文件夹中的所有 .ica 文件。

最佳答案

看起来您正在寻找用户的临时文件夹。如果您正在寻找它,您可以通过 $path = $env:temp 找到它。将其用于 @kekimian 使用的 $path。

成品看起来像这样:

$path = $env:temp
Get-ChildItem -path $path -Filter "*.ica" -Force -Recurse | Remove-Item -Force -Confirm:$False

关于powershell - 删除所有 .ica 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33506599/

相关文章:

Powershell lambda 作用域

git - Get-ChildItem 执行 git status

powershell - 在Powershell中一次移动或复制多个文件

powershell - 发送请求时在 PowerShell 中使用括号

excel - 仅当使用 powershell 知道索引号时才更改一个单元格的值

bash - 寻找匹配的 `'时出现意外的EOF

powershell - Powershell检查int和double类型

windows - 在 powershell 中替代 base64 解码

windows - 相当于 BASH(等) 'type' 命令的 PowerShell?

powershell - 将变量输出到文本文件