Hello everyone,
How to get local host (machine) name in PowerShell? I am using PowerShell 1.0. Thanks!
regards, George
You can just use the .NET Framework method:
[System.Net.Dns]::GetHostName()
also
$env:COMPUTERNAME
Long form:
get-content env:computername
Short form:
gc env:computername
Add don't forget that all your old console utilities work just fine in PowerShell:
PS> hostname KEITH1