-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productKeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues
Description
Steps to reproduce
function Test-Whatif {
[CmdletBinding(SupportsShouldProcess)]
param (
$String = 'Thing to do'
)
$target = 'Thing to Target'
$VerbosePreference ='continue'
if ($PSCmdlet.ShouldProcess($target,$string)){
"Did $string to $target"
}
}
Expected behavior
ShouldProcess would show Verbose output if $VerbosePreference is set either at the parent or in-function level
Actual behavior
Only works if -Verbose parameter is explicity specified on the cmdlet
Environment data
Name Value
---- -----
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
KevinMarquette, mklement0, Jaykul, twinter-amosfivesix, o-l-a-v and 2 more
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productKeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues