PowerShell - Scripting Best Practices
Given this function with Confirm support:
What happens when you run
[CmdletBinding(SupportsShouldProcess=$true)]
function Remove-File {
param([string]$Path)
if ($PSCmdlet.ShouldProcess($Path)) {
Remove-Item $Path
}
}What happens when you run
Remove-File -Path 'test.txt' -WhatIf?