VMware PowerCLI

The Best User Interface for your VMware Datacenter!

Move-Inventory -Item -Destination enhancement for inventory items Datastore and Datastore Cluster.

When I wanted to relocate Datastore Cluster with vCenter inventory with following steps

$folder = Get-Folder -name FOLDER
$item = Get-Inventory -name DATASTORE-CLUSTER
Move-Inventory -Item $item -Destination $folder

I have realized that Get-Inventory works with inventory types

Folder
Datacenter
VirtualMachine
Template
ResourcePool
VMHost
Cluster (this is a compute cluster and not a datastore cluster)

but Inventory items of Datastore nor Datastore Cluster are not there, therefore I would like to ask for enhancements.

Kyle Rudy provided following low level PowerShell code to achieve the task but enhancement of Move-Inventory command-let would be highly appreciated. 

#---------------MoveIntoFolder_Task---------------

$list = New-Object VMware.Vim.ManagedObjectReference[] (1)

$list[0] = New-Object VMware.Vim.ManagedObjectReference

$list[0].Type = 'StoragePod'

$list[0].Value = 'group-p110'

$_this = Get-View -Id 'Folder-group-s10712'

$_this.MoveIntoFolder_Task($list)

  • Guest
  • Feb 12 2019
  • Attach files