CDSoft.PowerShell/Admin.ps1

function Test-Admin {
    <#
    .SYNOPSIS
    Test whether in admin role currently.
    .DESCRIPTION
    Test whether in admin role currently.
    .OUTPUTS
    bool
    #>

    [CmdletBinding()]
    PARAM(
    )
    PROCESS {
        return ('S-1-5-32-544' -in [System.Security.Principal.WindowsIdentity]::GetCurrent().Groups)
    }
}