change pc host name with powershell code example Example: powershell change hostname Rename-Computer -NewName 'SomeHostname' -Restart