Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function Set-WithConfirmation {
- [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')]
- param ()
- if ($PSCmdlet.ShouldProcess('My Resource', 'Run')) {
- Write-Host "Did process"
- } else {
- Write-Host "Didn't process"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement