If you want to find the name of the local computer you use $env:COMPUTERNAME.
Except that doesn’t exist in Linux PowerShell v6 – you have to use $env:HOSTNAME
PowerShell 1 Consistency 0
I can live with having $env:HOSTNAME because I bet that… Read the full text.