How do I get the localhost name in PowerShell?
You can just use the .NET Framework method:
[System.Net.Dns]::GetHostName()
also
$env:COMPUTERNAME
Don't forget that all your old console utilities work just fine in PowerShell:
PS> hostname
KEITH1
You can just use the .NET Framework method:
[System.Net.Dns]::GetHostName()
also
$env:COMPUTERNAME
Don't forget that all your old console utilities work just fine in PowerShell:
PS> hostname
KEITH1