Skip to content

Get ComputerName

dscbot edited this page Feb 13, 2024 · 2 revisions

Get-ComputerName

SYNOPSIS

Returns the computer name cross-plattform.

SYNTAX

Get-ComputerName [<CommonParameters>]

DESCRIPTION

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

EXAMPLES

EXAMPLE 1

Get-ComputerName

Returns the computer 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