powershell hostname code example Example: powershell change hostname Rename-Computer -NewName 'SomeHostname' -Restart