Change windows computer name

Type:
Rename-Computer -NewName Dekstop-01 -LocalCredential “PC name”\”User name” -PassThru and press Enter

OR

Type:
Rename-Computer -NewName Desktop-01 -DomainCredential “Domain name”\”User name” -PassThru and press Enter

Type:
shutdown -r -t 0 to reboot the PC.

Article link:
Changing the Windows computer name