diff --git a/tools/windows-helper.ps1 b/tools/windows-helper.ps1 index 69f2b81..539c7dc 100644 --- a/tools/windows-helper.ps1 +++ b/tools/windows-helper.ps1 @@ -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)