0
我想递归删除所有没有扩展名的文件。在PowerShell中删除没有扩展名的文件
我已经有了下面的命令来删除具有特定扩展名的文件:
Remove-Item <PATH> -include *.tmp -force -recurse
我想递归删除所有没有扩展名的文件。在PowerShell中删除没有扩展名的文件
我已经有了下面的命令来删除具有特定扩展名的文件:
Remove-Item <PATH> -include *.tmp -force -recurse
Get-ChildItem "yourpath" -file -recurse | where {-not $_.extension} | Remove-Item -WhatIf
注意:删除应用行动-whatif。 -file
将只列出文件而不是文件夹
在get-childitem
中使用include
将限制范围仅限于该扩展名。