Hanging out in slack you get to see what's happening across the planet with PowerShell. I ran across an interesting PowerCLI problem reported by VMware Code user Edgar Sanchez.

He determined that when using Get-VMHostHardware on different client machines, he sometimes did not get results for CIM related items such as MemorySlotCount.

From my testing, all versions of that use this cmdlet (PowerCLI 6.0 R2 Build 3056836 and later) all behave the same way. So perhaps it could be better, but I'm not so sure it's a bug.

Understand that the error is returned in all cases. What you can control is how the system reacts to such failed CIM requests. In my testing, any of the following options work:

OPTION #1

This option sets the preference for the current session and successfully returns CIM results. You can also use a Scope of User or AllUsers instead of Session.

Set-PowerCLIConfiguration -Scope Session -InvalidCertificateAction Ignore -Confirm:$false
OPTION #2

Using the WaitForAllData parameter of the Get-VMHostHardware cmdlet successfully returns CIM results.

Get-VMHost | Get-Random | Get-VMHostHardware -WaitForAllData | Select-Object VMHost,MemorySlotCount
OPTION #3

Using the SkipAllSslCertificateChecks parameter of the Get-VMHostHardware cmdlet successfully returns CIM results.

Get-VMHost | Get-Random | Get-VMHostHardware -SkipAllSslCertificateChecks | Select-Object VMHost,MemorySlotCount

To test this out for yourself, see my script Get-EsxCimCertTolerance.