usuing the same vCenter, user and pass:
In machine n1:
PowerCLI C:\> Import-Module VMware.VimAutomation.Core
PowerCLI C:\> Connect-VIServer -Server $hosts -User $user -Password $pass -WarningAction Ignore
PowerCLI C:\> Get-ContentLibraryItem
Get-ContentLibraryItem : 08/12/2017 16:14:13 Get-ContentLibraryItem Specified argument was out of the range of valid values.
At line:1 char:1
+ Get-ContentLibraryItem
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ContentLibraryItem], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetContentLibraryItem
PowerCLI C:\> get-powercliversion
PowerCLI Version
----------------
VMware PowerCLI 6.5 Release 1 build 4624819
---------------
Component Versions
---------------
VMware Cis Core PowerCLI Component 6.5 build 4624453
VMware VimAutomation Core PowerCLI Component 6.5 build 4624450
VMWare ImageBuilder PowerCLI Component 6.5 build 4561891
VMWare AutoDeploy PowerCLI Component 6.5 build 4561891
VMware Vds PowerCLI Component 6.5 build 4624695
VMware Cloud PowerCLI Component 6.5 build 4624821
VMware HA PowerCLI Component 6.0 build 4525225
VMware HorizonView PowerCLI Component 7.0.2 build 4596620
VMware Licensing PowerCLI Component 6.5 build 4624822
VMware PCloud PowerCLI Component 6.5 build 4624825
VMware Storage PowerCLI Component 6.5 build 4624820
VMware vROps PowerCLI Component 6.5 build 4624824
VMware vSphere Update Manager PowerCLI 6.5 build 4540462
In machine n2:
PowerCLI C:\> Import-Module VMware.VimAutomation.Core
PowerCLI C:\> Connect-VIServer -Server $hosts -User $user -Password $pass -WarningAction Ignore
C:\Users\f3135606\Documents> Get-ContentLibraryItem
Name ContentLibrary ItemType SizeGB
---- -------------- -------- ------
Win2k12_R2_RV0.2-PDI LIBRARY_TEMPLATES_101 ovf 19,512
PowerCLI C:\> get-powercliversion
PowerCLI Version
----------------
VMware PowerCLI 6.5 Release 1 build 4624819
---------------
Component Versions
---------------
VMware Cis Core PowerCLI Component 6.5 build 4624453
VMware VimAutomation Core PowerCLI Component 6.5 build 4624450
VMware HorizonView PowerCLI Component 7.0.2 build 4596620
Would anyone know what's going on?
It looks like you are hitting the same issue as described in Get-ContentLibraryItem doesn't work
But there was never a solution afaik.
I would suggest to upgrade to 6.5.4 (which is PowerShell Gallery only)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Dont work. In one machine (with windows 10) works, but in another machine (windows server 2008 R2) dont:
Windows 10:
Import-Module VMware.PowerCli
Welcome to VMware PowerCLI!
Log in to a vCenter Server or ESX host: Connect-VIServer
To find out what commands are available, type: Get-VICommand
To show searchable help for all PowerCLI commands: Get-PowerCLIHelp
Once you've connected, display all virtual machines: Get-VM
If you need more help, visit the PowerCLI community: Get-PowerCLICommunity
Copyright (C) VMware, Inc. All rights reserved.
PS C:\Users\f3135606\Documents> Get-Module -Name VMware.PowerCli |Select-Object -Property Name,Version
Name Version
---- -------
VMware.PowerCli 6.5.4.7155375
PS C:\Users\f3135606\Documents> Connect-VIServer -Server 1.1.1.1 -User 'user' -Password '12345678' -WarningAction Ignore
Name Port User
---- ---- ----
1.1.1.1 443 user
PS C:\Users\f3135606\Documents> Get-ContentLibraryItem
Name ContentLibrary ItemType SizeGB
---- -------------- -------- ------
Win2k12_R2_RV0.2 LIBRARY_TEMPLATES_101 ovf 19,512
RedHat_7.2_x86_64 LIBRARY_TEMPLATES_101 ovf 3,496
Suse_12_x86_64 LIBRARY_TEMPLATES_101 ovf 5,420
OracleLinux_7.2_x86_... LIBRARY_TEMPLATES_101 ovf 5,314
Windows Server 2008 R2:
PS E:\Installers\powercli\new> Import-Module VMware.PowerCli
Welcome to VMware PowerCLI!
Log in to a vCenter Server or ESX host: Connect-VIServer
To find out what commands are available, type: Get-VICommand
To show searchable help for all PowerCLI commands: Get-PowerCLIHelp
Once you've connected, display all virtual machines: Get-VM
If you need more help, visit the PowerCLI community: Get-PowerCLICommunity
Copyright (C) VMware, Inc. All rights reserved.
PS E:\Installers\powercli\new> Get-Module -Name VMware.PowerCli |Select-Object -Property Name,Version
Name Version
---- -------
VMware.PowerCli 6.5.4.7155375
PS E:\Installers\powercli\new> Connect-VIServer -Server 1.1.1.1 -User 'user' -Password '12345678' -Warning
Action Ignore
Name Port User
---- ---- ----
1.1.1.1 443 user
PS E:\Installers\powercli\new> Get-ContentLibraryItem
Get-ContentLibraryItem : 11/12/2017 15:26:47 Get-ContentLibraryItem Specified argument was out of the range of valid values.
At line:1 char:1
+ Get-ContentLibraryItem
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ContentLibraryItem], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetContentLibr
aryItem