Skip to content

Fixes #6466 - New ErrorActionPreference Experimental Feature#6505

Merged
DCtheGeek merged 6 commits intoMicrosoftDocs:stagingfrom
chasewilson:chasewilson-ghi6466
Aug 20, 2020
Merged

Fixes #6466 - New ErrorActionPreference Experimental Feature#6505
DCtheGeek merged 6 commits intoMicrosoftDocs:stagingfrom
chasewilson:chasewilson-ghi6466

Conversation

@chasewilson
Copy link
Contributor

@chasewilson chasewilson commented Aug 17, 2020

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

  • Overview and Install
  • Learning PowerShell
    • PowerShell 101
    • Deep dives
    • Remoting
  • Release notes (What's New)
  • Windows PowerShell
    • WMF, ISE, release notes, etc.
  • DSC articles
  • Community resources
  • Sample scripts
  • Gallery articles
  • Scripting and development
    • Legacy SDK

Cmdlet reference & about_ topics

  • Version 7.1 preview content
  • Version 7.0 content
  • Version 6 content
  • Version 5.1 content

PR Checklist

  • I have read the contributors guide and followed the style and process guidelines
  • PR has a meaningful title
  • PR is targeted at the staging branch
  • All relevant versions updated
  • Includes content related to issues and PRs - see Closing issues using keywords.
  • This PR is ready to merge and is not Work in Progress
    • If the PR is work in progress, please add the prefix WIP: or [WIP] to the beginning of the
      title and remove the prefix when the PR is ready.

@opbld33
Copy link

opbld33 commented Aug 17, 2020

Docs Build status updates of commit 890353c:

✅ Validation status: passed

File Status Preview URL Details
reference/docs-conceptual/learn/experimental-features.md ✅Succeeded View (powershell-5.1)
View (powershell-6)
View (powershell-7)
View (powershell-7.1)

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:

@chasewilson chasewilson changed the title Chasewilson ghi6466 Fixes #6466 - New ErrorActionPreference Experimental Feature Aug 18, 2020
@chasewilson chasewilson requested a review from DCtheGeek August 18, 2020 15:01
@chasewilson
Copy link
Contributor Author

#sign-off @DCtheGeek

Comment on lines +179 to +180
affect the `stderr` output for native commands and does not write the error records from native
commands are not written to the `$Error` variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second half seems like some extra words got thrown in. Can you correct or rephrase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased entir section, let me know what you think

@opbld32
Copy link

opbld32 commented Aug 19, 2020

Docs Build status updates of commit 0b8dd4c:

✅ Validation status: passed

File Status Preview URL Details
reference/docs-conceptual/learn/experimental-features.md ✅Succeeded View (powershell-5.1)
View (powershell-6)
View (powershell-7)
View (powershell-7.1)

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:

@opbld30
Copy link

opbld30 commented Aug 19, 2020

Docs Build status updates of commit 8e784da:

✅ Validation status: passed

File Status Preview URL Details
reference/docs-conceptual/learn/experimental-features.md ✅Succeeded View (powershell-5.1)
View (powershell-6)
View (powershell-7)
View (powershell-7.1)

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:

@opbld31
Copy link

opbld31 commented Aug 20, 2020

Docs Build status updates of commit 332d762:

✅ Validation status: passed

File Status Preview URL Details
reference/docs-conceptual/learn/experimental-features.md ✅Succeeded View (powershell-5.1)
View (powershell-6)
View (powershell-7)
View (powershell-7.1)

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:

@DCtheGeek DCtheGeek merged commit 9e2dfd4 into MicrosoftDocs:staging Aug 20, 2020

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

$ErrorActionPreference doesn't affect stderr output for native commands

7 participants