Function Show-AdminStatus {
    <#
    .SYNOPSIS
        Checks whether the current PowerShell session is running as Administrator.

    .DESCRIPTION
        Inspects the current Windows identity and returns $true if the session
        is elevated (running as Administrator), $false otherwise.

    .EXAMPLE
        Show-AdminStatus
        Returns $true if running as Administrator, $false otherwise.

    .EXAMPLE
        if (Show-AdminStatus) { Write-Host "Elevated" } else { Write-Host "Not elevated" }
        Useful as a guard condition before operations that require admin rights.

    .OUTPUTS
        System.Boolean
    #>
    [CmdletBinding()]
    param()

    Process {
        try {
            $identity  = [System.Security.Principal.WindowsIdentity]::GetCurrent()
            $principal = New-Object System.Security.Principal.WindowsPrincipal($identity)
            $isAdmin   = $principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)

            Write-Verbose "Administrator status: $isAdmin"
            return $isAdmin
        }
        catch {
            Write-Warning "Could not determine admin status. Error: $($_.Exception.Message)"
            return $false
        }
    }
}
