如何使用PowerShell删除文件到recyle bin? [英] how to remove files to recyle bin with PowerShell?
本文介绍了如何使用PowerShell删除文件到recyle bin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Get-ChildItem -recurse |其中{$ _.PSIsContainer -and`
@(Get-ChildItem -Lit $ _。Fullname -r | Where {!$ _.PSIsContainer})。Length -eq 0} |
Remove-Item -recurse -whatif
现在我可以使用上面的PowerShell脚本永久删除文件,但现在我希望将文件删除到recyle bin?
任何人都可以帮助我?
Get-ChildItem -recurse | Where {$_.PSIsContainer -and `
@(Get-ChildItem -Lit $_.Fullname -r | Where {!$_.PSIsContainer}).Length -eq 0} |
Remove-Item -recurse -whatif
now i can use the above PowerShell script to delete files permanently, but now i want the files be removed to recyle bin?
any one can help me?
推荐答案
_。PSIsContainer -and`
@(Get-ChildItem -Lit
_.PSIsContainer -and `
@(Get-ChildItem -Lit
_。全名-r |其中{!
_.Fullname -r | Where {!
_。PSIsContainer})。长度-eq 0} |
Remove-Item -recurse -whatif
现在我可以使用上面的PowerShell脚本永久删除文件,但现在我想把文件移到recyle bin?
任何人都可以帮我吗?
_.PSIsContainer}).Length -eq 0} |
Remove-Item -recurse -whatif
now i can use the above PowerShell script to delete files permanently, but now i want the files be removed to recyle bin?
any one can help me?
这篇关于如何使用PowerShell删除文件到recyle bin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文