Last active
August 29, 2018 07:56
-
-
Save shaneis/ef28110ed710609fec227bddd68a7b82 to your computer and use it in GitHub Desktop.
Edit all the things!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Test-EditedConfirm | |
function Test-EditedConfirm { | |
[CmdletBinding(SupportsShouldProcess, | |
ConfirmImpact = 'High')] | |
param( | |
[int[]]$Numbers | |
) | |
process { | |
foreach ($num in $Numbers) { | |
if ($PSCmdlet.ShouldProcess("Guess what this does? [$num]", | |
"Are you sure you want to process: [$num]", | |
'STOP!')) { | |
"Current numbers: [$num]" | |
} | |
} | |
} | |
} | |
Test-EditedConfirm -Numbers $Numbers | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment