Hi all,
Been banging my head with this one its drving me mad hopefully someone can help please. I am using LucD excellent Orphaned files and folders - Spring cleaning - LucD notes script to identify orphaned VMDK files. I have ran the script and exported the results into a CSV file.
What I need to do now is to run a script that will move every VMDK in the csv file to another datastore. I am struggling to get the powercli command correct and I am hoping someone will be able to help please.
I have tried these:
Move-HardDisk -Harddisk (Import-Csv C:\csvfilename.csv | %{$_.Name})
Cannot bind parameter 'HardDisk'. Cannot convert the "filename_0001.vmdk" value of type "System.String" to type "VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.HardDisk"
And
Get-HardDisk -Name (Import-Csv C:\Users\DeanE\Documents\ListofDeletedDC2_A_T1_SRM_PL003VMDKs.csv | %{$_.Name})
Get-HardDisk Please specify at least one of the following: Path, Datastore, VirtualMachine, Template or Snapshot.
And
Get-HardDisk -Datastore DatastoreName -Name (Import-Csv C:\csvfilename.csv | %{$_.Name})
Parameter set cannot be resolved using the specified named parameters.
Any help would be greatly appreciated please.
Thanks very much