Update windows-helper.ps1

This commit is contained in:
Alexandr Bogomyakov
2024-09-28 21:37:42 +03:00
committed by GitHub
parent 98d993423d
commit dd5f0c4e2f

View File

@ -1,4 +1,4 @@
$url = Read-Host "Please enter the URL for the JSON configuration, Use HTTPS:// instead of SS://"
$url = Read-Host "Please enter the URL for the JSON configuration"
$comment = Read-Host "Comment [server, country, etc]"
$port = Read-Host "Please enter the port to use for sslocal"
@ -11,6 +11,13 @@ $cmdFilePath = "$extractPath\run_${comment}.cmd"
$taskName = "Shadowsocks_Task_${comment}"
$logFile = "$extractPath\Log_${comment}.log"
if ($url -notmatch "^[a-z]+://") {
$url = "https://$url"
} elseif ($url -like "ssconf://*") {
$url = $url -replace "^ssconf://", "https://"
}
function Test-Admin {
$currentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object Security.Principal.WindowsPrincipal($currentUser)