Fixes #6466 - New ErrorActionPreference Experimental Feature#6505
Fixes #6466 - New ErrorActionPreference Experimental Feature#6505DCtheGeek merged 6 commits intoMicrosoftDocs:stagingfrom chasewilson:chasewilson-ghi6466
Conversation
…r in PowerShell 7.1" This reverts commit 8b0672d.
|
Docs Build status updates of commit 890353c: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
|
#sign-off @DCtheGeek |
| affect the `stderr` output for native commands and does not write the error records from native | ||
| commands are not written to the `$Error` variable. |
There was a problem hiding this comment.
The second half seems like some extra words got thrown in. Can you correct or rephrase?
There was a problem hiding this comment.
Rephrased entir section, let me know what you think
|
Docs Build status updates of commit 0b8dd4c: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
|
Docs Build status updates of commit 8e784da: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
|
Docs Build status updates of commit 332d762: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
|
|
||
| When this experimental feature is enabled, error records from native commands are not written to the | ||
| `$Error` variable and the preference variable `$ErrorActionPreference` does not affect the `stderr` | ||
| output for native commands. |
There was a problem hiding this comment.
It is important to note that this only applies when stderr is explicitly redirected with 2> - by default, stderr output does not touch PowerShell's error stream and is passed through to the host, so nothing is recorded in $Error and $ErrorActionPreference doesn't come into play.
That explicitly sending stderr output elsewhere (e.g., 2>$null or 2>errs.txt) suddenly also records it in $Error and makes it subject to $ErrorActionPreference, as is currently the case, never made any sense, which is why this shouldn't be an experimental feature but a bug fix.
PR Summary
Adds information about new experimental feature
PR Context
Fixes #6466
Fixes AB#1759889
Select the area of the Table of Contents containing the documents being changed.
Conceptual content
Cmdlet reference & about_ topics
PR Checklist
WIP:or[WIP]to the beginning of thetitle and remove the prefix when the PR is ready.