Last active
September 29, 2023 12:26
-
-
Save Winand/414eab7a401d56046ce5e4d54e03dee7 to your computer and use it in GitHub Desktop.
Start cloak client from PowerShell script
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
# Self-elevate the script if required | |
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { | |
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) { | |
# $CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments | |
# Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine | |
Start powershell.exe -Verb RunAs -ArgumentList "cd $pwd; & $($MyInvocation.MyCommand.Path)" | |
Exit | |
} | |
} | |
route ADD 198.__.___.___ MASK 255.255.255.255 192.168.88.1 | |
try { | |
.\ck-client-windows-amd64-v2.7.0.exe -u -s 198.__.___.___ -p 443 | |
} finally { | |
route DELETE 198.__.___.___ MASK 255.255.255.255 192.168.88.1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment