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