Skip to content

Instantly share code, notes, and snippets.

@Sambardo
Created February 28, 2018 20:04
Show Gist options
  • Save Sambardo/b966b04e19a1cdae671ac5d5eb42f8ff to your computer and use it in GitHub Desktop.
Save Sambardo/b966b04e19a1cdae671ac5d5eb42f8ff to your computer and use it in GitHub Desktop.
Function MyFunction
{
[cmdletbinding(SupportsShouldProcess,
ConfirmImpact = "high")]
param($service)
if($PSCmdlet.ShouldProcess($service,"Fetch service"))
{
get-service -name $service
}
}
MyFunction -service alg -confirm:$false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment