Power shell to access Internet behind a proxy server with authentication
Useful links to refer.
- $Creds=Get-Credential
- $proxy = New-Object System.Net.WebProxy
- $proxy.Address = [uri]"http://xxx.xxx.xxx.xxx:xx"
- $proxy.Credentials = $Creds
- [System.Net.WebRequest]::DefaultWebProxy = $proxy
- Invoke-WebRequest -Uri "https://google.com" -UseBasicParsing
Useful links to refer.
No comments:
Post a Comment