used for is you have already moved the files, for instance I updated from using the computer name \\storage\ to the FQDN

 

get Excel file

get-VMHardDiskDrive -VMName * | select VMName,ControllerType,ControllerNumber,ControllerLocation,Path | Export-Csv -Delimiter “;” -Path “c:\temp\vmvhdloc.csv”

In excel file update path to what you want it to be (note this does not move the file)

import-csv c:\temp\vmvhdloc.csv | ForEach-Object {
set-VMHardDiskDrive -VMName $_.VM -ControllerType $_.CT -ControllerNumber 0 -ControllerLocation $_.CL -Path $_.newpath
}

get-vm * | Get-VMHardDiskDrive