Title: Preference variables don't propagate to script block of ForEach-Object -Parallel · Issue #14672 · PowerShell/PowerShell · GitHub
Open Graph Title: Preference variables don't propagate to script block of ForEach-Object -Parallel · Issue #14672 · PowerShell/PowerShell
X Title: Preference variables don't propagate to script block of ForEach-Object -Parallel · Issue #14672 · PowerShell/PowerShell
Description: Steps to reproduce $ErrorActionPreference = 'Stop' $WhatIfPreference = 'True' $DebugPreference = 'Continue' $VerbosePreference = 'Continue' $WarningPreference = 'Ignore' $ConfirmPreference = 'None' @(1) | ForEach-Object -Parallel { [PSCu...
Open Graph Description: Steps to reproduce $ErrorActionPreference = 'Stop' $WhatIfPreference = 'True' $DebugPreference = 'Continue' $VerbosePreference = 'Continue' $WarningPreference = 'Ignore' $ConfirmPreference = 'None'...
X Description: Steps to reproduce $ErrorActionPreference = 'Stop' $WhatIfPreference = 'True' $DebugPreference = 'Continue' $VerbosePreference = 'Continue' $WarningPreference = '...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/14672
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Preference variables don't propagate to script block of ForEach-Object -Parallel","articleBody":"## Steps to reproduce\r\n\r\n```powershell\r\n$ErrorActionPreference = 'Stop'\r\n$WhatIfPreference = 'True'\r\n$DebugPreference = 'Continue'\r\n$VerbosePreference = 'Continue'\r\n$WarningPreference = 'Ignore'\r\n$ConfirmPreference = 'None'\r\n\r\n@(1) | ForEach-Object -Parallel {\r\n [PSCustomObject] @{ Variable = 'ErrorActionPreference'; Expected = $using:ErrorActionPreference; Actual = $ErrorActionPreference }\r\n [PSCustomObject] @{ Variable = 'WhatIfPreference'; Expected = $using:WhatIfPreference; Actual = $WhatIfPreference }\r\n [PSCustomObject] @{ Variable = 'DebugPreference'; Expected = $using:DebugPreference; Actual = $DebugPreference }\r\n [PSCustomObject] @{ Variable = 'VerbosePreference'; Expected = $using:VerbosePreference; Actual = $VerbosePreference }\r\n [PSCustomObject] @{ Variable = 'WarningPreference'; Expected = $using:WarningPreference; Actual = $WarningPreference }\r\n [PSCustomObject] @{ Variable = 'ConfirmPreference'; Expected = $using:ConfirmPreference; Actual = $ConfirmPreference }\r\n}\r\n\r\n@(1) | ForEach-Object -Parallel {\r\n [CmdLetBinding()] Param()\r\n [PSCustomObject] @{ Variable = 'ErrorActionPreference'; Expected = $using:ErrorActionPreference; Actual = $ErrorActionPreference }\r\n [PSCustomObject] @{ Variable = 'WhatIfPreference'; Expected = $using:WhatIfPreference; Actual = $WhatIfPreference }\r\n [PSCustomObject] @{ Variable = 'DebugPreference'; Expected = $using:DebugPreference; Actual = $DebugPreference }\r\n [PSCustomObject] @{ Variable = 'VerbosePreference'; Expected = $using:VerbosePreference; Actual = $VerbosePreference }\r\n [PSCustomObject] @{ Variable = 'WarningPreference'; Expected = $using:WarningPreference; Actual = $WarningPreference }\r\n [PSCustomObject] @{ Variable = 'ConfirmPreference'; Expected = $using:ConfirmPreference; Actual = $ConfirmPreference }\r\n}\r\n```\r\n\r\n## Expected behavior\r\n\r\n```none\r\nVariable Expected Actual\r\n-------- -------- ------\r\nErrorActionPreference Stop Stop\r\nWhatIfPreference True True\r\nDebugPreference Continue Continue\r\nVerbosePreference Continue Continue\r\nWarningPreference Ignore Ignore\r\nConfirmPreference None None\r\n```\r\n\r\n## Actual behavior\r\n\r\n```none\r\nVariable Expected Actual\r\n-------- -------- ------\r\nErrorActionPreference Stop Continue\r\nWhatIfPreference True False\r\nDebugPreference Continue SilentlyContinue\r\nVerbosePreference Continue SilentlyContinue\r\nWarningPreference Ignore Continue\r\nConfirmPreference None High\r\n```\r\n\r\n## Environment data\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 7.1.1\r\nPSEdition Core\r\nGitCommitId 7.1.1\r\nOS Microsoft Windows 10.0.19042\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/vojtech-vit-deltatre","@type":"Person","name":"vojtech-vit-deltatre"},"datePublished":"2021-01-27T08:40:24Z","url":"https://github.com/PowerShell/PowerShell/issues/14672"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9d7c9b43-a4e5-f7c4-f2c2-419d9e239e56 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A472:15979A:1D5F37:2A187C:6AFDC29F |
| html-safe-nonce | 934c5af1740844bcc1f6beeb977247a131e32afce264c9f49ebea01f4518d466 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDcyOjE1OTc5QToxRDVGMzc6MkExODdDOjZBRkRDMjlGIiwidmlzaXRvcl9pZCI6IjM5NDMzMjg1OTI4NzU2MDI1OTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 95f605caa57cf1e131c1454de52af4ac29a494a4c7e868c8349c01a699f5f330 |
| hovercard-subject-tag | issue:794892448 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/14672/issue_layout |
| twitter:image | https://opengraph.githubassets.com/470067d60a6161c8475ce93218b27788dcdee8740649cd0a39bf81aa2ff6575f/PowerShell/PowerShell/issues/14672 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/470067d60a6161c8475ce93218b27788dcdee8740649cd0a39bf81aa2ff6575f/PowerShell/PowerShell/issues/14672 |
| og:image:alt | Steps to reproduce $ErrorActionPreference = 'Stop' $WhatIfPreference = 'True' $DebugPreference = 'Continue' $VerbosePreference = 'Continue' $WarningPreference = 'Ignore' $ConfirmPreference = 'None'... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vojtech-vit-deltatre |
| hostname | github.com |
| expected-hostname | github.com |
| None | 35c6bf57da1370dc64866160540c0ee9f825f291935b3bf6ec5492b00e35f3a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ab48c73a2978548773f5f24717ed9e58508befdb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width