one of the tasks I want to automate is changing my computer name from an user input.
$rename = read-host "please enter the computer name:"
write-host "will change to $rename" -foregroundcolor black -backgroundcolor white
$computername = Get-WmiObject Win32_ComputerSystem
$computername.Rename($rename)
Restart-Computer
This script runs fine but my computer name doesn't change. I'd like to know what I did wrong/