summaryrefslogtreecommitdiff
path: root/_site/get.ps1
diff options
context:
space:
mode:
authorDESKTOP-AJSJJMA\Admin2022-07-25 18:03:20 +0000
committerDESKTOP-AJSJJMA\Admin2022-07-25 18:03:20 +0000
commit5081d805b05f5874a6439dc49311e038cca1595c (patch)
tree7e7654d12f086d21c9720a7d270e32647e3ab242 /_site/get.ps1
parent1de003fcb03eb9a5d53b9961adcf4abb055108f7 (diff)
downloadmassgrave.dev-5081d805b05f5874a6439dc49311e038cca1595c.zip
MAS 1.6
Diffstat (limited to '_site/get.ps1')
-rw-r--r--_site/get.ps145
1 files changed, 33 insertions, 12 deletions
diff --git a/_site/get.ps1 b/_site/get.ps1
index 6a91468..70b9da8 100644
--- a/_site/get.ps1
+++ b/_site/get.ps1
@@ -1,12 +1,33 @@
-$Tls12 = [Enum]::ToObject([System.Net.SecurityProtocolType], 3072); [System.Net.ServicePointManager]::SecurityProtocol = $Tls12;
-
-$DownloadUrl = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/master/MAS/All-In-One-Version/MAS_1.5_AIO_CRC32_21D20776.cmd'
-$FilePath = "$env:USERPROFILE\Desktop\MAS_1.5_AIO_CRC32_21D20776.cmd"
-
-if($PSVersionTable.PSVersion.Major -lt 3){
-(New-Object System.Net.WebClient).DownloadFile($DownloadUrl, $FilePath)
-}else {
-Invoke-WebRequest -Uri $DownloadURL -UseBasicParsing -OutFile $FilePath
-}
-
-Start-Process -FilePath $FilePath
+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;
+
+$DownloadURL = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/master/MAS/All-In-One-Version/MAS_AIO.cmd'
+
+try {
+ Invoke-WebRequest -Uri $DownloadURL -UseBasicParsing -OutFile "$env:TEMP\MAS.cmd"
+} catch {
+ Write-Error $_
+ Exit-Script -ExitCode 1
+}
+
+Start-Process -FilePath "$env:TEMP\MAS.cmd" -Wait
+Exit-Script