有KMS激活,非要用鬼知道会不会加料的脚本,你很勇啊。。
# Check massgrave.dev for more details
$ErrorActionPreference = "Stop"
write-host Write-Host "The current command (irm https://massgrave.dev/get | iex) will be retired on Aug 31, 2024." Write-Host -ForegroundColor Green "Use the new command (irm https://get.activated.win | iex) moving forward." write-host
# Enable TLSv1.2 for compatibility with older clients for current session [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12
$DownloadURL1 = ‘https://raw.githubusercontent.com/massgravel/Microsoft-Activation-Scripts/0884271c4fcdc72d95bce7c5c7bdf77ef4a9bcef/MAS/All-In-One-Version/MAS_AIO-CRC32_31F7FD1E.cmd’ $DownloadURL2 = ‘https://bitbucket.org/WindowsAddict/microsoft-activation-scripts/raw/0884271c4fcdc72d95bce7c5c7bdf77ef4a9bcef/MAS/All-In-One-Version/MAS_AIO-CRC32_31F7FD1E.cmd’
$URLs = @($DownloadURL1, $DownloadURL2) $RandomURL1 = Get-Random -InputObject $URLs $RandomURL2 = $URLs -ne $RandomURL1
try { $response = Invoke-WebRequest -Uri $RandomURL1 -UseBasicParsing } catch { $response = Invoke-WebRequest -Uri $RandomURL2 -UseBasicParsing }
$rand = Get-Random -Maximum 99999999 $isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match ‘S-1-5-32-544’) $FilePath = if ($isAdmin) { "$env:SystemRootTempMAS_$rand.cmd" } else { "$env:TEMPMAS_$rand.cmd" }
$ScriptArgs = "$args " $prefix = "@::: $rand `r`n" $content = $prefix + $response Set-Content -Path $FilePath -Value $content
Start-Process $FilePath $ScriptArgs -Wait
$FilePaths = @("$env:TEMPMAS*.cmd", "$env:SystemRootTempMAS*.cmd") foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }