Disable the script from running on non-Windows

This commit is contained in:
Calyx Hikari 2025-06-29 13:09:52 +08:00
parent 1e05e3ee4a
commit 4ada8f2fde
4 changed files with 20 additions and 0 deletions

5
32
View file

@ -3,6 +3,11 @@
Add-Type -AssemblyName System.IO.Compression.FileSystem
if ($PSVersionTable.PSEdition -ne 'Desktop' -and $env:OS -ne 'Windows_NT') {
Write-Warning "Please run it on Windows. "
exit 1
}
$flagPath = "$env:TEMP\elevation_success.flag"
if (Test-Path $flagPath) { Remove-Item $flagPath -ErrorAction SilentlyContinue }