February 2019
Intermediate to advanced
626 pages
15h 51m
English
The Confirm parameter causes a command to prompt before an action is taken; for example, the Confirm parameter forces Remove-Item to prompt when a file is to be removed:
PS> Set-Location $env:TEMPPS> New-Item IMadeThisUp.txt -ForcePS> Remove-Item .\IMadeThisUp.txt -Confirm ConfirmAre you sure you want to perform this action?Performing the operation "Remove File" on target "C:\Users\whoami\AppData\Local\Temp\IMadeThisUp.txt".[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
We have seen that a confirmation prompt may be forcefully requested in the previous example. In a similar manner, confirmation prompts may be suppressed; for example, the value of the Confirm parameter may be explicitly ...
Read now
Unlock full access