microsoft / microsoft/CSS-Exchange
[Issue] Confirm-ProxyServer does not work on Powershell 7
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 1.3k
- Forks
- 395
- Avg merge
- 14h 7m
- Merged PRs (30d)
- 5
Description
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:
GetSystemWebProxy() is deprecated and there is a new way to do this: https://github.com/dotnet/runtime/issues/24756#issuecomment-519618435
[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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the shared Confirm-ProxyServer function and reproduce the failure by running a script with -Verbose on PowerShell 7. Compare the Windows PowerShell behavior of GetSystemWebProxy() with [System.Net.Http.HttpClient]::DefaultProxy.GetProxy("foo"), then verify that proxy detection works appropriately in both PowerShell versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- networking, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100