Remove-Item
Delete files, folders, as well as registry keys and subkeys. This command can only be run through PowerShell. More information: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/remove-item.
- Remove specific files or registry keys (without subkeys):
Remove-Item
- Remove hidden or read-only files:
Remove-Item -Force
- Remove specific files or registry keys interactively prompting before each removal:
Remove-Item -Confirm
- Remove specific files and directories recursively (Windows 10 version 1909 or later):
Remove-Item -Recurse
- Remove specific Windows registry keys and all its subkeys:
Remove-Item -Recurse
- Simulate the deletion process:
Remove-Item -WhatIf
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
