#region PowerShell Admin Check $winIdent = [Security.Principal.WindowsIdentity]::GetCurrent() $WinPrinc = [Security.Principal.WindowsPrincipal] $winIdent $AdminId = [Security.Principal.WindowsBuiltInRole] "Administrator" if(-Not $WinPrinc.IsInRole($AdminId)) { $ErrorActionPreference = "Stop" throw "You must have administrative privileges to import this module." } #endregion