Repository navigation
Closed
Closed
Copy link
Labels
Issue-Enhancementthe issue is more of a feature request than a bugResolution-DuplicateThe issue is a duplicate.WG-RemotingPSRP issues with any transport layer
Milestone
Description
Steps to reproduce
$ErrorActionPreference = 'Stop'
$WhatIfPreference = 'True'
$DebugPreference = 'Continue'
$VerbosePreference = 'Continue'
$WarningPreference = 'Ignore'
$ConfirmPreference = 'None'
@(1) | ForEach-Object -Parallel {
[PSCustomObject] @{ Variable = 'ErrorActionPreference'; Expected = $using:ErrorActionPreference; Actual = $ErrorActionPreference }
[PSCustomObject] @{ Variable = 'WhatIfPreference'; Expected = $using:WhatIfPreference; Actual = $WhatIfPreference }
[PSCustomObject] @{ Variable = 'DebugPreference'; Expected = $using:DebugPreference; Actual = $DebugPreference }
[PSCustomObject] @{ Variable = 'VerbosePreference'; Expected = $using:VerbosePreference; Actual = $VerbosePreference }
[PSCustomObject] @{ Variable = 'WarningPreference'; Expected = $using:WarningPreference; Actual = $WarningPreference }
[PSCustomObject] @{ Variable = 'ConfirmPreference'; Expected = $using:ConfirmPreference; Actual = $ConfirmPreference }
}
@(1) | ForEach-Object -Parallel {
[CmdLetBinding()] Param()
[PSCustomObject] @{ Variable = 'ErrorActionPreference'; Expected = $using:ErrorActionPreference; Actual = $ErrorActionPreference }
[PSCustomObject] @{ Variable = 'WhatIfPreference'; Expected = $using:WhatIfPreference; Actual = $WhatIfPreference }
[PSCustomObject] @{ Variable = 'DebugPreference'; Expected = $using:DebugPreference; Actual = $DebugPreference }
[PSCustomObject] @{ Variable = 'VerbosePreference'; Expected = $using:VerbosePreference; Actual = $VerbosePreference }
[PSCustomObject] @{ Variable = 'WarningPreference'; Expected = $using:WarningPreference; Actual = $WarningPreference }
[PSCustomObject] @{ Variable = 'ConfirmPreference'; Expected = $using:ConfirmPreference; Actual = $ConfirmPreference }
}
Expected behavior
Variable Expected Actual
-------- -------- ------
ErrorActionPreference Stop Stop
WhatIfPreference True True
DebugPreference Continue Continue
VerbosePreference Continue Continue
WarningPreference Ignore Ignore
ConfirmPreference None None
Actual behavior
Variable Expected Actual
-------- -------- ------
ErrorActionPreference Stop Continue
WhatIfPreference True False
DebugPreference Continue SilentlyContinue
VerbosePreference Continue SilentlyContinue
WarningPreference Ignore Continue
ConfirmPreference None High
Environment data
Name Value
---- -----
PSVersion 7.1.1
PSEdition Core
GitCommitId 7.1.1
OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugResolution-DuplicateThe issue is a duplicate.WG-RemotingPSRP issues with any transport layer
Activity
[-]Some Preference variables are not propagated to script block of ForEach-Object -Parallel[/-][+]Preference variables don't propagate to script block of ForEach-Object -Parallel[/+]jborean93 commentedon Jan 27, 2021
Looks to be a duplicate of #14602 and #12240
TravisEz13 commentedon Apr 28, 2021
remoting working group: #12240