massgrave.dev/_site/get.ps1

20 lines
639 B
PowerShell
Raw Normal View History

2022-07-25 20:03:20 +02:00
# Enable TLSv1.2 for compatibility with older clients
2022-07-27 18:09:57 +02:00
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12
2022-07-25 20:03:20 +02:00
$DownloadURL = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/master/MAS/All-In-One-Version/MAS_AIO.cmd'
2022-07-27 18:09:57 +02:00
$FilePath = "$env:TEMP\MAS.cmd"
2022-07-25 20:03:20 +02:00
try {
2022-07-27 18:09:57 +02:00
Invoke-WebRequest -Uri $DownloadURL -UseBasicParsing -OutFile $FilePath
2022-07-25 20:03:20 +02:00
} catch {
Write-Error $_
2022-07-27 04:36:27 +02:00
Return
}
2022-07-27 19:16:09 +02:00
if (Test-Path $FilePath) {
2022-07-27 18:09:57 +02:00
Start-Process $FilePath -Wait
2022-07-27 19:16:09 +02:00
$item = Get-Item -LiteralPath $FilePath
$item.Delete()
2022-07-25 20:03:20 +02:00
}