Hello,
Consider following chain of commands:
# Import specific module version
Import-Module -Name 'VMWare.PowerCLI' -RequiredVersion '12.0.0.15947286'
# Connect to vCenter
Connect-VIServer -Server myServer
Name Port User
---- ---- ----
myServer 443 <masked>
# Get object from Content Library
Get-ContentLibraryItem -Name "template" -ContentLibrary "My Library"
Name ContentLibrary ItemType SizeGB
---- -------------- -------- ------
template My Library ovf 1.879
# command works as expected, no problems here
# now I decide to disconnect from vCenter
Disconnect-VIServer
# also works without any problems, but now for whatever reason I decide to connect back
Connect-VIServer -Server myServer
Name Port User
---- ---- ----
myServer 443 <masked>
# and repeat Get-ContentLibraryItem command
Get-ContentLibraryItem -Name "template" -ContentLibrary "My Library"
Get-ContentLibraryItem : 7/10/2020 10:14:20 AM Get-ContentLibraryItem Value cannot be null.
Parameter name: collection
At line:1 char:1
+ Get-ContentLibraryItem -Name "template" -ContentLibrary "My Li ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ContentLibraryItem], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.ContentLibrary
.GetContentLibraryItem
From now on, Get-ContentLibraryItem cmdlet doesn't work until I completely restart my PowerShell shell.
I also observed that this problem does not manifest itself if I skip module import step. Also, module version `11.5.0.14912921` does not have this problem.
I suggest you open an SR for this.
And yes, PowerCLI is supported.
If GSS claims you need Developer Support, point them to PowerCLI Support Breakdown
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'll try to open SR, thanks for the hint. In the past my SRs has been declined because I don't have active Developer Support subscription.
I unmarked proposition to open SR as correct answer because apparently I need to have at least some form of support agreement. Although I understand reasons why Support Requests require paid subscriptions, but I strongly believe that reporting bugs should be exempt from it. I work in a transnational organization with huge IT and procurement departments. As a technical professional, I have zero will or interest to go through bureaucracy of my organization to find persons with valid support plan to report a bug.
Out of my goodwill I already spent time to isolate the bug and came up with steps to reproduce. Because I genuinely want to make product better I decided to share this information with developers, but if, in order to deliver this information, I need to pay money or find other proofs that somebody in my organization already paid for the subscription - my goodwill ends here.
I understand.
In fact, I raised an Idea for just such a thing, see Online repository with known issues (and fixes) for supported releases.
But the feedback on the suggestions has been minimal I'm afraid :smileycry:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I tried the same and found no issues. Probably, SR would be the best way to troubleshoot this issue as suggested.
No disrespect, but either you didn't reproduce commands exactly the same (perhaps you skipped explicit Import-Module step) or there are more variables to the issue, which I don't know about. Personally I tested it on two different machines with having 'VMWare.PowerCLI' module versions '12.0.0.15947286' and '11.5.0.14912921' installed side-by-side (which is typical if one runs Update-Module command) and with module version '12.0.0.15947286' only. In both cases the issue is reproduced 100%.
As for SR, I will say it again: I will not open SR as long as they require me to have active support subscription. It is not Service Request per se that I need. This problem doesn't prevent me from doing my job. I am reporting a bug, which can even be considered as me doing a favor to a company. This post pursuits 2 targets: let people know that this bug exists (developers and maybe others who may stumble upon it) and highlight the issue that bug reporting should not require active support subscription. With this, my moral obligations are fulfilled.
VMware may have resolved the issue. I have PowerCLI version 12.1.0.17009493 and I just tested it and it works fine.
