Skip to content

Conversation

@daxian-dbw
Copy link
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
Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

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

Leave a comment

Copy link
Collaborator

@powercode powercode left a comment

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
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