For VMware-based VMs using RDMs or vVols, use the cmdlet
Get-PsbVmPersistentID if the VMware administrator changes the friendly name of the VM as seen in vCenter. Subsequent automation will fail if you only declare the VMName parameter.
$VMPID = Get-PSBVMPersistentId -VCenterAddress $vcenterendpoint -VCenterCredential $vcentercredential -VmName $vmname