-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move trust for ProductBinaries to Unrestricted. #5511
Conversation
b5e8c7a
to
662b32e
Compare
@@ -189,6 +185,10 @@ private bool CheckPolicy(ExternalScriptInfo script, PSHost host, out Exception r | |||
#endif | |||
if (_executionPolicy == ExecutionPolicy.Unrestricted) | |||
{ | |||
// Product binaries are always trusted | |||
if (SecuritySupport.IsProductBinary(path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the execution policy is unrestricted, then I think we don't need this check anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chatted with Travis offline. This check is needed to bypass files downloaded from the internet to $PSHome\Module
when it's Unrestricted
.
Need to add a comment about this.
@@ -189,6 +185,10 @@ private bool CheckPolicy(ExternalScriptInfo script, PSHost host, out Exception r | |||
#endif | |||
if (_executionPolicy == ExecutionPolicy.Unrestricted) | |||
{ | |||
// Product binaries are always trusted | |||
if (SecuritySupport.IsProductBinary(path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chatted with Travis offline. This check is needed to bypass files downloaded from the internet to $PSHome\Module
when it's Unrestricted
.
Need to add a comment about this.
Can we add a test? |
7f2fe7b
to
73c15ab
Compare
} | ||
) | ||
|
||
It "$TestTypePrefix Running <testScript> Module should return <error>" -TestCases $testDate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: should be $testData
) | ||
|
||
It "$TestTypePrefix Running <testScript> Module should return <error>" -TestCases $testDate { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing param
block
} | ||
catch | ||
{ | ||
$exception = $_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to use ShouldBeErrorId
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I accidentally pushed an incomplete commit. I have updated the PR.
cf20b34
to
3094513
Compare
) | ||
foreach($testScript in $testScripts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, $testScripts was not defined in this scope, so nothing was being run.
Note, issue #5559 was filed when adding tests due to an issue with the tests. I have marked the affected tests to be skipped. |
error = $null | ||
} | ||
) | ||
It "$TestTypePrefix Running <testScript> Script should throw '<error>'" -TestCases $skipTestData -Skip {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be Pending
and not Skipped
?
fixes #5485