Function Test-ShouldProcess { 
    [CmdletBinding(SupportsShouldProcess = $true )] 
    Param() 
    if ($PSCmdlet.ShouldProcess('Test','Appel de ShouldProcess')) 
    { 
        Write-Host 'Execution de l''action, car $true' 
    }else{ 
        Write-Host 'Simulation de l''action, car $false' 
    } 
}

Test-ShouldProcess
Test-ShouldProcess -WhatIf
Test-ShouldProcess -Confirm

#confirm impact medium
Function Test-ShouldProcess { 
    [CmdletBinding( 
        SupportsShouldProcess = $true, 
        ConfirmImpact = 'medium'
    )] 
    Param() 
    $ConfirmPreference = 'Low' 
    if ($PSCmdlet.ShouldProcess('Test','Appel ShouldProcess'))  
    { 
        Write-Host 'Réponse Low : Oui' 
    }else{ 
        Write-Host 'Réponse Low : Non' 
    } 
} 

# Help message
Function Test-ShouldProcess { 
    [CmdletBinding( 
           SupportsShouldProcess = $true, 
           ConfirmImpact = 'medium',
     	HelpURI = 'https://nicolasbn.github.com/PowerShellAdvanced/Help/Test-ShouldProcess.md'      
     )] 
    Param() 
    $ConfirmPreference = 'Low' 
    if ($PSCmdlet.ShouldProcess('Test','Appel ShouldProcess'))  
    { 
           Write-Host 'Réponse Low : Oui' 
    }else{ 
           Write-Host 'Réponse Low : Non' 
    } 
} 

PS > Get-Help Test-ShouldProcess -Online
