Hello,
Thank you for asking in forums.
Please check the following link for more information.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/rename-computer?view=powershell-6
Mark it as answer if your question has solved in order to keep forums updated.