VMware Cloud Community
antoinems
Contributor
Contributor

Get-ContentLibraryItem doesn't work

Hello,

I just installed PowerCLI 6.3 Release 1, in order to get 'Get-ContentLibraryItem' cmdlet available.

After launching the console, and connect to a vCenter, I run 'Get-ContentLibraryItem' command but, nothing happens.

The console doesn't return anything and it's like stuck. I can't even stop the command by CTRL+C.

It works for the other commands with no issue (get-vm, get-vmhost, and so on).

Has anybody been able to get content library information via PowerCLi?

If anybody can help, no idea how to troubleshoot this issue.

Thanks in advance.

Reply
0 Kudos
21 Replies
SchottGun
Contributor
Contributor

I was able to finally get this working. And I feel like an idiot.  In all of our powercli scripts, we connect to our vcenters via the vcenter server name only, not the full fqdn. Evidently there's a difference, as when I started using the full fqdn, the get-contentlibraryitem commandlet started working.  Thanks to all that looked into this.

Reply
0 Kudos
dcasota1
Contributor
Contributor

Hi, this worked for me too and for the situation 'missing datastore in a library' I have had to put some try-catch-finally.

   try { $datastoreService = Get-CisService com.vmware.vcenter.datastore }catch{}
   try { $datastore = $datastoreService.get($library.storage_backings.datastore_id) }catch{}
Reply
0 Kudos