Use Power shell ISE to create the script
You just need to copy and paste the script and change some values
#THIS SCRIPT MUST BE EDITED AS SHOWN IN THE EXAMPLES
#Connect to vCenter ip or hostname
#Example Connect-VIServer 10.60.x.xxx
Connect-VIServer <vcenter-name>
#Connect to esxcli you must specify hosname
#Example $esxcli = Get-EsxCli -VMhost esx1.lab.com -V2
$esxcli = Get-EsxCli -VMhost <esxi-host-name> -V2
#Define new password for root
#Example $arg.password = ‘Changeme!'
$arg = $esxcli.system.account.set.CreateArgs()
$arg.id = ‘root’
$arg.password = ‘NewPassword’
$arg.passwordconfirmation = $arg.password
#Set new password leave this as default
$esxcli.system.account.set.Invoke($arg)