Friday, January 5, 2018

PowerShellTip: Get Computer Name

To easily retrieve computer name in Windows PowerShell, use the environmental variable ComputerName.

[PS]$env:ComputerName

This can be useful in scripts.

No comments:

Post a Comment