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