diff options
| author | DESKTOP-AJSJJMA\Admin | 2023-03-16 18:09:16 +0000 |
|---|---|---|
| committer | DESKTOP-AJSJJMA\Admin | 2023-03-16 18:09:16 +0000 |
| commit | 4845932d784c2b1e384b6d0f215ac874d5d70a94 (patch) | |
| tree | 20b2b1dd52f60b9d4a6c8a53732310c6ae748fde /_site/get.ps1 | |
| parent | 53950f18766ca6faf7ffdf15de7409ab91eeb160 (diff) | |
| download | massgrave.dev-4845932d784c2b1e384b6d0f215ac874d5d70a94.zip | |
1.8
Diffstat (limited to '_site/get.ps1')
| -rw-r--r-- | _site/get.ps1 | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/_site/get.ps1 b/_site/get.ps1 index a3f995a..07cc7d9 100644 --- a/_site/get.ps1 +++ b/_site/get.ps1 @@ -1,27 +1,27 @@ -$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.cmd' -$DownloadURL2 = 'https://gitlab.com/massgrave/microsoft-activation-scripts/-/raw/master/MAS/All-In-One-Version/MAS_AIO.cmd' - -$rand = Get-Random -Maximum 1000 -$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" } - -try { - $response = Invoke-WebRequest -Uri $DownloadURL -UseBasicParsing -} -catch { - $response = Invoke-WebRequest -Uri $DownloadURL2 -UseBasicParsing -} - -$ScriptArgs = "$args " -$prefix = "@REM $rand `r`n" -$content = $prefix + $response -Set-Content -Path $FilePath -Value $content - -Start-Process $FilePath $ScriptArgs -Wait - -$FilePaths = @("$env:TEMP\MAS*.cmd", "$env:SystemRoot\Temp\MAS*.cmd") -foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item } +$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.cmd'
+$DownloadURL2 = 'https://gitlab.com/massgrave/microsoft-activation-scripts/-/raw/master/MAS/All-In-One-Version/MAS_AIO.cmd'
+
+$rand = Get-Random -Maximum 1000
+$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" }
+
+try {
+ $response = Invoke-WebRequest -Uri $DownloadURL -UseBasicParsing
+}
+catch {
+ $response = Invoke-WebRequest -Uri $DownloadURL2 -UseBasicParsing
+}
+
+$ScriptArgs = "$args "
+$prefix = "@REM $rand `r`n"
+$content = $prefix + $response
+Set-Content -Path $FilePath -Value $content
+
+Start-Process $FilePath $ScriptArgs -Wait
+
+$FilePaths = @("$env:TEMP\MAS*.cmd", "$env:SystemRoot\Temp\MAS*.cmd")
+foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }
|
