Hello,
i want to move a exist VM in vCenter into a VM Subfolder that naming is for example like these:
testdc\vm\Workloads\test-workloads\test-ab
I have added these folder path in to avriable.
also the vm is in the $vm variable with Get-VM...
But when i want to move the vm into the cm subfolder with Move-VM $vm -Destination $vmfolder i receive the error:
Move-VM Could not find VIContainer with name 'testdc\vm\Workloads\test-workloads\test-ab'
For info: the subfolder here for example, exists many more in other vm Subfolder...
So how can i just move the exists vm into the right vm folder???
Use Get-Folder to get a Folder object pointing to that specific folder.
Then use that Folder object on the Destination parameter.
To get a Folder object from a folderpath, you might want to have a look at my Folder by Path post.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Use Get-Folder to get a Folder object pointing to that specific folder.
Then use that Folder object on the Destination parameter.
To get a Folder object from a folderpath, you might want to have a look at my Folder by Path post.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Many Thx LucD ![]()
It works great.
