Update install.ps1
This commit is contained in:
parent
4c7593359d
commit
c5145b2d90
1 changed files with 12 additions and 0 deletions
12
install.ps1
12
install.ps1
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue