PowerShell Adding -WhatIf and -Confirm support to your cmdlet


Example

function Invoke-MyCmdlet {
    [CmdletBinding(SupportsShouldProcess = $true)]
    param()
    # ...
}