diff options
Diffstat (limited to '_site/get.ps1')
| -rw-r--r-- | _site/get.ps1 | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/_site/get.ps1 b/_site/get.ps1 index 70b9da8..f514f44 100644 --- a/_site/get.ps1 +++ b/_site/get.ps1 @@ -1,22 +1,3 @@ -function Exit-Script {
-
- [CmdletBinding()]
- param(
- [Parameter(Position = 0)]
- [int]
- $ExitCode = 0
- )
-
- process {
- if (Test-Path -Path "$env:TEMP\MAS.cmd") {
- Remove-Item -Path "$env:TEMP\MAS.cmd" -Force
- }
-
- exit $ExitCode
- }
-
-}
-
# Enable TLSv1.2 for compatibility with older clients
$Tls12 = [Enum]::ToObject([System.Net.SecurityProtocolType], 3072); [System.Net.ServicePointManager]::SecurityProtocol = $Tls12;
@@ -26,8 +7,11 @@ try { Invoke-WebRequest -Uri $DownloadURL -UseBasicParsing -OutFile "$env:TEMP\MAS.cmd"
} catch {
Write-Error $_
- Exit-Script -ExitCode 1
+ Return
+}
+
+if (Test-Path -Path "$env:TEMP\MAS.cmd") {
+ Start-Process -FilePath "$env:TEMP\MAS.cmd" -Wait
+ Remove-Item -Path "$env:TEMP\MAS.cmd" -Force
}
-Start-Process -FilePath "$env:TEMP\MAS.cmd" -Wait
-Exit-Script
|
