Update get.ps1 script
This commit is contained in:
parent
17a838045f
commit
c046fa4b60
@ -9,18 +9,25 @@ $DownloadURL1 = 'https://bitbucket.org/WindowsAddict/microsoft-activation-script
|
|||||||
$DownloadURL2 = 'https://codeberg.org/massgravel/Microsoft-Activation-Scripts/raw/branch/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
|
$DownloadURL3 = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/master/' + $CommonURLPart
|
||||||
|
|
||||||
$rand = Get-Random -Maximum 99999999
|
$URLs = @($DownloadURL1, $DownloadURL2)
|
||||||
$isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match 'S-1-5-32-544')
|
$RandomURL1 = Get-Random -InputObject $URLs
|
||||||
$FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\MAS_$rand.cmd" } else { "$env:TEMP\MAS_$rand.cmd" }
|
$RandomURL2 = $URLs -notmatch $RandomURL1 | Get-Random
|
||||||
|
|
||||||
$RandomURL = Get-Random -InputObject $DownloadURL1, $DownloadURL2
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = Invoke-WebRequest -Uri $RandomURL -UseBasicParsing
|
$response = Invoke-WebRequest -Uri $RandomURL1 -UseBasicParsing
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
try {
|
||||||
|
$response = Invoke-WebRequest -Uri $RandomURL2 -UseBasicParsing
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
$response = Invoke-WebRequest -Uri $DownloadURL3 -UseBasicParsing
|
$response = Invoke-WebRequest -Uri $DownloadURL3 -UseBasicParsing
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$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" }
|
||||||
|
|
||||||
$ScriptArgs = "$args "
|
$ScriptArgs = "$args "
|
||||||
$prefix = "@:: $rand `r`n"
|
$prefix = "@:: $rand `r`n"
|
||||||
|
19
get.ps1
19
get.ps1
@ -9,18 +9,25 @@ $DownloadURL1 = 'https://bitbucket.org/WindowsAddict/microsoft-activation-script
|
|||||||
$DownloadURL2 = 'https://codeberg.org/massgravel/Microsoft-Activation-Scripts/raw/branch/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
|
$DownloadURL3 = 'https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/master/' + $CommonURLPart
|
||||||
|
|
||||||
$rand = Get-Random -Maximum 99999999
|
$URLs = @($DownloadURL1, $DownloadURL2)
|
||||||
$isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match 'S-1-5-32-544')
|
$RandomURL1 = Get-Random -InputObject $URLs
|
||||||
$FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\MAS_$rand.cmd" } else { "$env:TEMP\MAS_$rand.cmd" }
|
$RandomURL2 = $URLs -notmatch $RandomURL1 | Get-Random
|
||||||
|
|
||||||
$RandomURL = Get-Random -InputObject $DownloadURL1, $DownloadURL2
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = Invoke-WebRequest -Uri $RandomURL -UseBasicParsing
|
$response = Invoke-WebRequest -Uri $RandomURL1 -UseBasicParsing
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
try {
|
||||||
|
$response = Invoke-WebRequest -Uri $RandomURL2 -UseBasicParsing
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
$response = Invoke-WebRequest -Uri $DownloadURL3 -UseBasicParsing
|
$response = Invoke-WebRequest -Uri $DownloadURL3 -UseBasicParsing
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$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" }
|
||||||
|
|
||||||
$ScriptArgs = "$args "
|
$ScriptArgs = "$args "
|
||||||
$prefix = "@:: $rand `r`n"
|
$prefix = "@:: $rand `r`n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user