I'm trying to move some VMs to specifics inventory folders, my environment is organized like this:
DTC\Folder1\Production
DTC\Folder2\Production
I'd like to know if we had some way to move by folderid
Thanks
The Move-VM cmdlet doesn't accept an Id on the InventoryLocation parameter.
But there are some ways around this.
Get the destination folder in a variable, and use that as the value for the InventoryLocation.
The Get-Folder cmdlet does have an Id parameter.
Another option is to use my Get-FolderByPath function.
Then you retrieve the intended folder by providing the full path, store the result in a variable and use that for the InventoryLocation parameter.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi, thanks for replying,
I've tried to use the parameter InventoryLocation with no success, it does not accept the full path.
If write the folder "production", move-vm -Vm test -InventoryLocation "Production", then the error message happens:
The specified parameter 'InventoryLocation' expects a single value, but your name criteria 'XYZ' corresponds to multiple values.
That is not what I suggested.
You can't use a folderpath on the InventoryLocation.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference