diff options
| author | WindowsAddict | 2024-03-18 07:44:33 +0000 |
|---|---|---|
| committer | WindowsAddict | 2024-03-18 07:44:33 +0000 |
| commit | e466ef6be7a8a2a80e066145abe5e3c401aea6bb (patch) | |
| tree | 29fc6d27fcf9a6b19c236f90e0c41738b2370b36 /_site/get.ps1 | |
| parent | b30e7ac66bf339613dda831cc1b4b61c39e53218 (diff) | |
| download | massgrave.dev-e466ef6be7a8a2a80e066145abe5e3c401aea6bb.zip | |
Randomize download URL
Diffstat (limited to '_site/get.ps1')
| -rw-r--r-- | _site/get.ps1 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/_site/get.ps1 b/_site/get.ps1 index 6fe4820..3baf280 100644 --- a/_site/get.ps1 +++ b/_site/get.ps1 @@ -4,18 +4,22 @@ $ErrorActionPreference = "Stop" # Enable TLSv1.2 for compatibility with older clients
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
-$DownloadURL = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/master/MAS/All-In-One-Version/MAS_AIO-CRC32_9AE8AFBA.cmd'
-$DownloadURL2 = 'https://bitbucket.org/WindowsAddict/microsoft-activation-scripts/raw/master/MAS/All-In-One-Version/MAS_AIO-CRC32_9AE8AFBA.cmd'
+$CommonURLPart = 'MAS/All-In-One-Version/MAS_AIO-CRC32_9AE8AFBA.cmd'
+$DownloadURL1 = 'https://bitbucket.org/WindowsAddict/microsoft-activation-scripts/raw/master/' + $CommonURLPart
+$DownloadURL2 = 'https://codeberg.org/massgravel/Microsoft-Activation-Scripts/raw/branch/master/' + $CommonURLPart
+$DownloadURL3 = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/master/' + $CommonURLPart
$rand = Get-Random -Maximum 99999999
$isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match 'S-1-5-32-544')
$FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\MAS_$rand.cmd" } else { "$env:TEMP\MAS_$rand.cmd" }
+$RandomURL = Get-Random -InputObject $DownloadURL1, $DownloadURL2
+
try {
- $response = Invoke-WebRequest -Uri $DownloadURL -UseBasicParsing
+ $response = Invoke-WebRequest -Uri $RandomURL -UseBasicParsing
}
catch {
- $response = Invoke-WebRequest -Uri $DownloadURL2 -UseBasicParsing
+ $response = Invoke-WebRequest -Uri $DownloadURL3 -UseBasicParsing
}
$ScriptArgs = "$args "
|
