You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# File: c:\temp\Invoke-MVP.ps1functionInvoke-MVP {
[CmdletBinding(SupportsShouldProcess=$true)] # This line shows an exception
[OutputType('System.String')]
Param (
[Parameter()]
[switch]$Force# just to hide PSAvoidShouldContinueWithoutForce for this MVP
)
{
if ($PSCmdlet.ShouldContinue('Should I continue','Should I continue')) {
'I continued'
}
}
}
No error; using ShouldContinue should be equivalent to using ShouldProcess (for which we don't see this issue).
Actual behavior
RuleName Severity ScriptName Line Message
-------- -------- -------------- ---- -------
PSShouldProcess Warning Invoke-MVP.ps1 2 'Invoke-POC' has the ShouldProcess attribute but does not
call ShouldProcess/ShouldContinue.
Steps to reproduce
Expected behavior
No error; using
ShouldContinue
should be equivalent to usingShouldProcess
(for which we don't see this issue).Actual behavior
Environment data
The text was updated successfully, but these errors were encountered: