summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluzea2022-04-10 14:39:54 +0000
committerluzea2022-04-10 14:39:54 +0000
commit132994f06915c11eb5adb835f0e69bce8320d3b2 (patch)
tree9b80ea4a14b091353acad823ae1cd0461deb8dac
parent7ac40995d30c74b840515a8a34921fb276e61342 (diff)
downloadmassgrave.dev-132994f06915c11eb5adb835f0e69bce8320d3b2.zip
Add get-mas.ps1
-rw-r--r--get-mas.ps134
1 files changed, 34 insertions, 0 deletions
diff --git a/get-mas.ps1 b/get-mas.ps1
new file mode 100644
index 0000000..ebc051a
--- /dev/null
+++ b/get-mas.ps1
@@ -0,0 +1,34 @@
+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 and TLSv1.3 for compatibility with older clients
+$TLS12Protocol = [System.Net.SecurityProtocolType] 'Tls12', 'Tls13'
+[System.Net.ServicePointManager]::SecurityProtocol = $TLS12Protocol
+
+$DownloadURL = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/master/MAS/All-In-One-Version/MAS_1.5_AIO_CRC32_21D20776.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