Internal/Generic/Test-Administrator.ps1
#Requires -Version 5.0 function Test-Administrator { return (New-Object -TypeName Security.Principal.WindowsPrincipal -ArgumentList ([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) } |