Compare commits
No commits in common. "2172c5789b5544b8abdf19698cd8883df1f95528" and "86075abe20b5b89140a3fed0fe034c9ce6e3b6c0" have entirely different histories.
2172c5789b
...
86075abe20
35
get
35
get
@ -1,42 +1,21 @@
|
|||||||
# The following code is hosted on https://get.activated.win for https://massgrave.dev
|
# The following get.ps1 code is hosted on get.activated.win for massgrave.dev. For more info, please visit massgrave.dev.
|
||||||
|
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
# Enable TLSv1.2 for compatibility with older clients for current session
|
# Enable TLSv1.2 for compatibility with older clients for current session
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
|
|
||||||
$DownloadURL1 = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/52d4c52dba8e29a3c1fb295c8946dbe6cf2f0239/MAS/All-In-One-Version-KL/MAS_AIO.cmd'
|
$DownloadURL1 = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/35e044ddc85eed60b27b37c48371bd19cdc678b7/MAS/All-In-One-Version/MAS_AIO-CRC32_8C3AA7E0.cmd'
|
||||||
$DownloadURL2 = 'https://dev.azure.com/massgrave/Microsoft-Activation-Scripts/_apis/git/repositories/Microsoft-Activation-Scripts/items?path=/MAS/All-In-One-Version-KL/MAS_AIO.cmd&versionType=Commit&version=52d4c52dba8e29a3c1fb295c8946dbe6cf2f0239'
|
$DownloadURL2 = 'https://bitbucket.org/WindowsAddict/microsoft-activation-scripts/raw/35e044ddc85eed60b27b37c48371bd19cdc678b7/MAS/All-In-One-Version/MAS_AIO-CRC32_8C3AA7E0.cmd'
|
||||||
|
|
||||||
$URLs = @($DownloadURL1, $DownloadURL2)
|
$URLs = @($DownloadURL1, $DownloadURL2)
|
||||||
$ShuffledURLs = $URLs | Sort-Object { Get-Random }
|
$RandomURL1 = Get-Random -InputObject $URLs
|
||||||
|
$RandomURL2 = ($URLs -ne $RandomURL1)[0]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = Invoke-WebRequest -Uri $ShuffledURLs[0] -UseBasicParsing
|
$response = Invoke-WebRequest -Uri $RandomURL1 -UseBasicParsing
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
$response = Invoke-WebRequest -Uri $ShuffledURLs[1] -UseBasicParsing
|
$response = Invoke-WebRequest -Uri $RandomURL2 -UseBasicParsing
|
||||||
}
|
|
||||||
|
|
||||||
# Verify script integrity
|
|
||||||
$releaseHash = '39961D29B07D59D54A709AA7B152269ADC6349752660A0C66D627B09DF18B9B6'
|
|
||||||
$stream = New-Object IO.MemoryStream
|
|
||||||
$writer = New-Object IO.StreamWriter $stream
|
|
||||||
$writer.Write($response)
|
|
||||||
$writer.Flush()
|
|
||||||
$stream.Position = 0
|
|
||||||
$hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($stream)) -replace '-'
|
|
||||||
if ($hash -ne $releaseHash) {
|
|
||||||
Write-Warning "Hash ($hash) mismatch, aborting!`nReport this issue at https://massgrave.dev/troubleshoot"
|
|
||||||
$response = $null
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check for AutoRun registry which may create issues with CMD
|
|
||||||
$paths = "HKCU:\SOFTWARE\Microsoft\Command Processor", "HKLM:\SOFTWARE\Microsoft\Command Processor"
|
|
||||||
foreach ($path in $paths) {
|
|
||||||
if (Get-ItemProperty -Path $path -Name "Autorun" -ErrorAction SilentlyContinue) {
|
|
||||||
Write-Warning "Autorun registry found, CMD may crash! `nManually copy-paste the below command to fix...`nRemove-ItemProperty -Path '$path' -Name 'Autorun'"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$rand = [Guid]::NewGuid().Guid
|
$rand = [Guid]::NewGuid().Guid
|
||||||
|
Loading…
Reference in New Issue
Block a user