Skip to content

Get UserName

dscbot edited this page Jul 20, 2024 · 1 revision

Get-UserName

SYNOPSIS

Returns the user name cross-plattform.

SYNTAX

Get-UserName [<CommonParameters>]

DESCRIPTION

Returns the current user name cross-plattform. The variable $env:USERNAME does not exist cross-platform which hinders development and testing on macOS and Linux. Instead this command can be used to get the user name cross-plattform.

EXAMPLES

EXAMPLE 1

Get-UserName

Returns the user name regardless of platform.

PARAMETERS

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.String

NOTES

RELATED LINKS

Clone this wiki locally