Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix 'using module' when module has non-terminating errors handled with 'SilentlyContinue'#4711

Merged
daxian-dbw merged 1 commit into
PowerShell:masterPowerShell/PowerShell:masterfrom
daxian-dbw:loadmoduledaxian-dbw/PowerShell:loadmoduleCopy head branch name to clipboard
Sep 1, 2017
Merged

Fix 'using module' when module has non-terminating errors handled with 'SilentlyContinue'#4711
daxian-dbw merged 1 commit into
PowerShell:masterPowerShell/PowerShell:masterfrom
daxian-dbw:loadmoduledaxian-dbw/PowerShell:loadmoduleCopy head branch name to clipboard

Conversation

@daxian-dbw

Copy link
Copy Markdown
Member

Attempt to fix #4695

Compiler.LoadModule assumes that when ps.HadErrors == true the error stream is not empty. However, when SilentlyContinue is specified as the error action, the non-terminating error is not kept in ErrorOutputPipe of the cmdlet and thus does not appear in ps.Streams.Error. So when ps.HadErrors == true while ps.Streams.Error is empty, it suggests it's OK to ignore the errors because they are explicitly suppressed with SilentlyContinue error action.

So in my opinion, the expected behavior of "using module .\mod.psm1" in this case should be successful, as if ps.HaddErrors is false.

@daxian-dbw daxian-dbw requested review from lzybkr and powercode August 30, 2017 23:23
@daxian-dbw daxian-dbw removed the request for review from vors August 30, 2017 23:24
@daxian-dbw daxian-dbw self-assigned this Aug 30, 2017
@daxian-dbw daxian-dbw requested a review from vors August 30, 2017 23:29

@SteveL-MSFT SteveL-MSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@iSazonov iSazonov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Leave a comment

@powercode powercode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@daxian-dbw daxian-dbw merged commit 795de73 into PowerShell:master Sep 1, 2017
@daxian-dbw daxian-dbw deleted the loadmodule branch September 1, 2017 15:54
@daxian-dbw

Copy link
Copy Markdown
Member Author

Thanks all for the review!

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.

ArgumentOutOfRangeException in Compiler.LoadModule

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.