Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Edit all the things!
#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
You can’t perform that action at this time.