-
Notifications
You must be signed in to change notification settings - Fork 188
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
Save & restore the state of [Net.ServicePointManager]::SecurityProtocol #240
Save & restore the state of [Net.ServicePointManager]::SecurityProtocol #240
Conversation
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.
Thanks for taking on this change!
Invoke-WebRequest
will throw an exception if it doesn't return back a successful result. You're going to need to capture the current securityProtocol
outside the scope of the try
, and then you'll need to restore it within the context of a finally
for that try/catch/finally
expression in order for the change to be robust.
Thanks again!
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.
Thanks for taking this on! Will get it merged shortly.
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
Save & restore the state of [Net.ServicePointManager]::SecurityProtocol
Issues Fixed
Fixes #230
References
Checklist
Comment-based help added/updated, including examples.Changes to the manifest file follow the manifest guidance.Unit tests were added/updated and are all passing. See testing guidelines.Relevant usage examples have been added/updated in USAGE.md.