|
@@ -1,4 +1,6 @@
|
|
new-module -name netclient-install -scriptblock {
|
|
new-module -name netclient-install -scriptblock {
|
|
|
|
+ $ErrorActionPreference = "Stop"
|
|
|
|
+
|
|
function Quit {
|
|
function Quit {
|
|
param(
|
|
param(
|
|
$Text
|
|
$Text
|
|
@@ -24,7 +26,7 @@ new-module -name netclient-install -scriptblock {
|
|
Invoke-WebRequest -Uri $url -OutFile $outpath
|
|
Invoke-WebRequest -Uri $url -OutFile $outpath
|
|
$args = @("Comma","Separated","Arguments")
|
|
$args = @("Comma","Separated","Arguments")
|
|
$procWG = Start-Process -Filepath "$env:userprofile\Downloads\wireguard-installer.exe" -ArgumentList $args
|
|
$procWG = Start-Process -Filepath "$env:userprofile\Downloads\wireguard-installer.exe" -ArgumentList $args
|
|
- if ($procWG -eq $null) {}
|
|
|
|
|
|
+ if ($procWG -eq $null) {
|
|
Start-Sleep -Seconds 5
|
|
Start-Sleep -Seconds 5
|
|
} else {
|
|
} else {
|
|
$procWG.WaitForExit()
|
|
$procWG.WaitForExit()
|
|
@@ -53,7 +55,7 @@ new-module -name netclient-install -scriptblock {
|
|
}
|
|
}
|
|
$NetArgs = @("join","-t",$token)
|
|
$NetArgs = @("join","-t",$token)
|
|
$procNC = Start-Process -Filepath $outpath -ArgumentList $NetArgs
|
|
$procNC = Start-Process -Filepath $outpath -ArgumentList $NetArgs
|
|
- if ($procNC -eq $null) {}
|
|
|
|
|
|
+ if ($procNC -eq $null) {
|
|
Start-Sleep -Seconds 5
|
|
Start-Sleep -Seconds 5
|
|
} else {
|
|
} else {
|
|
$procNC.WaitForExit()
|
|
$procNC.WaitForExit()
|