MiniSystemInfo.psm1

# MiniSystemInfo.psm1

function Get-SystemUptime {
    # Get the system's uptime
    $uptime = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
    $currentTime = Get-Date
    $uptimeDuration = $currentTime - $uptime
    return $uptimeDuration
}

function Get-CurrentUserInfo {
    # Get the current user's information
    $currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent()
    $userInfo = @{
        UserName = $currentUser.Name
        AuthenticationType = $currentUser.AuthenticationType
        IsSystemAccount = $currentUser.IsSystem
        IsGuestAccount = $currentUser.IsGuest
        IsAnonymous = $currentUser.IsAnonymous
    }
    return $userInfo
}

Export-ModuleMember -Function Get-SystemUptime, Get-CurrentUserInfo