PowerShell Download & run-as script
PowerShell script
#Predefine necessary information
$Username = “DOMAIN\Administrator”
$Password = “PASSWORD”
#Create credential object
$SecurePassWord = ConvertTo-SecureString -AsPlainText $Password -Force
$Cred = New-Object -TypeName “System.Management.Automation.PSCredential” -ArgumentList $Username, $SecurePassWord
#Download file from website
$Url = “http://192.168.20.247/test.test”
$Path = “$env:temp\example.exe”
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile( $url, $path )
(New-Object System.Net.WebClient).DownloadFile($url, $output)
#Start shell
Start-Process $Path -Credential $Cred
Save as run-as-admin.ps1
If needed compile your .ps1 file to .exe with PS2EXE
https://gallery.technet.microsoft.com/PS2EXE-Convert-PowerShell-9e4e07f1