Hello,
I feel stupid but I can't move a VM into a specific VM folder ?
When I do it the old way, using "-Destination" I get a warning about "destination switch" being deprecated + an error telling me that index is out of array bounds.
Okey.
I do it using -InventoryLocation, no warning, but still out of bounds.
Please tell me what am I doing wrong ?
PS C:\Users\Shar> $vm = get-vm "tests-guillaume-infra-sn"
PS C:\Users\Shar> $vm
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
tests-guillaume-i... PoweredOff 2 4,000
PS C:\Users\Shar> $folder = get-folder -name WSUS
PS C:\Users\Shar> $folder
Name Type
---- ----
WSUS VM
PS C:\Users\Shar> Move-VM -InventoryLocation $folder -VM $vm
Move-VM : 29/03/2019 14:44:28 Move-VM L'index se trouve en dehors des limites du tableau.
Au caractère Ligne:1 : 1
+ Move-VM -InventoryLocation $folder -VM $vm
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Move-VM], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM
I found by luck that there seems to be a new cmdlet, "Move-Inventory" but still same error :
PS C:\Users\Shar> Move-Inventory -Item $vm -Destination $folder
Move-Inventory : 29/03/2019 14:51:04 Move-Inventory L'index se trouve en dehors des limites du tableau.
Au caractère Ligne:1 : 1
+ Move-Inventory -Item $vm -Destination $folder
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Move-Inventory], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveInventory
PS C:\Users\Shar> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.14393.576
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.576
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS C:\Users\Shar> Get-Module VMware.PowerCLI
PS C:\Users\Shar> Get-Module VMware.PowerCLI -ListAvailable
Répertoire : C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 11.2.0.... VMware.PowerCLI
Manifest 11.0.0.... VMware.PowerCLI
--EDIT--
I just checked with same powercli but against a vcenter 6.0, no problem
So this may be a bug with vcenter 6.7 ?