Skip to content
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

[Issue] Confirm-ProxyServer does not work on Powershell 7 #2065

Open
bill-long opened this issue Apr 19, 2024 · 0 comments
Open

[Issue] Confirm-ProxyServer does not work on Powershell 7 #2065

bill-long opened this issue Apr 19, 2024 · 0 comments
Assignees
Labels

Comments

@bill-long
Copy link
Member

Describe the issue

The Confirm-ProxyServer shared function always fails on PowerShell 7. Run any script with -Verbose and observe:

Calling Confirm-ProxyServer
Proxy server configuration detected
Unable to check for proxy server configuration

On PowerShell 7, this line throws, so we always end up in the catch:

image

GetSystemWebProxy() is deprecated and there is a new way to do this: dotnet/runtime#24756 (comment)

[System.Net.Http.HttpClient]::DefaultProxy.GetProxy("foo")

However, that doesn't work in Windows PowerShell.

Not clear if we should fix this or just let it continue to work this way. In PS7 we will never try to use a proxy. This apparently didn't cause an issue for customers running CVE-2023-23397.ps1. I know we had some using PS7 when running against Exchange Online.

@bill-long bill-long self-assigned this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant