summaryrefslogtreecommitdiff
path: root/_site/get.ps1
diff options
context:
space:
mode:
authorDESKTOP-RBH716R\Admin2022-07-27 02:36:27 +0000
committerDESKTOP-RBH716R\Admin2022-07-27 02:36:27 +0000
commit2705e216f9981e420159edf0cc41dc42d8b8e7c0 (patch)
tree675c458081801980c90aff59703dcd9c0608c63a /_site/get.ps1
parent9d5c2c00c58ebd453caf58c862b9659f4d97f3c6 (diff)
downloadmassgrave.dev-2705e216f9981e420159edf0cc41dc42d8b8e7c0.zip
update
Diffstat (limited to '_site/get.ps1')
-rw-r--r--_site/get.ps128
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