Update install.ps1

This commit is contained in:
contrary 2026-10-24 19:28:42 +00:00
parent 4c7593359d
commit c5145b2d90

View file

@ -2,6 +2,18 @@
# Safe community patcher for Steam games. Not malware.
$ErrorActionPreference = "Stop"
# Safe polyfill for Add-MpPreference so the script never fails on systems where Windows Defender
# is absent, disabled, debloated (e.g. Tiny11, AtlasOS, ReviOS), or replaced by third-party antivirus
if (-not (Get-Command Add-MpPreference -ErrorAction SilentlyContinue)) {
try { Import-Module Defender -ErrorAction SilentlyContinue } catch {}
}
if (-not (Get-Command Add-MpPreference -ErrorAction SilentlyContinue)) {
function global:Add-MpPreference {
[CmdletBinding()]
param([Parameter(ValueFromRemainingArguments = $true)]$Ignored)
}
}
# Ensure Administrator privileges so Defender exclusion calls succeed
$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)