-WhatIf and -Confirm

say it: “wut if and kun-FURM” /wʌt ɪf ænd kənˈfɝm/

`-WhatIf` previews changes; `-Confirm` asks before each one.

What is -WhatIf and -Confirm?

-WhatIf shows what a command would do without doing it; -Confirm asks before each change. Great safety nets for deletes.

Get-ChildItem *.tmp | Remove-Item -WhatIf

Level: Freelancer · More PowerShell terms at this level

Updated