Mittwoch, 20. Dezember 2023
PowerShell: Prüfen, ob Administrator-Rechte vorhanden
Run only as Admin
Run only as Admin
if (! ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { throw "Run with administrator rights" }
Kategorie: programmierung