AsBuiltReport / AsBuiltReport.VMware.vSphere

Repository for AsBuiltReport VMware vSphere module
https://www.asbuiltreport.com
MIT License
110 stars 39 forks source link

You cannot call a method on a null-valued expression: If Cluster-InfoLevel -gt 2 #86

Closed ClaudiuSchuster closed 2 years ago

ClaudiuSchuster commented 3 years ago

Hi,

if i set my Cluster Info Level on a VCSA 7 running on pwsh 7.12 to higher then 2 i get this: New-AsBuiltReport: You cannot call a method on a null-valued expression. (After a Cluster Verbose-Line Like '... AdmissionControl ...', sry i did not captured it on my tests)

The vCenter (VCSA) has 'empty' Clusters configured (without Hosts), probably this is the reason i thought....

Best Regards

tpcarman commented 3 years ago

Hi @ClaudiuSchuster, Given that you're seeing the 'Admission Control' message in the verbose output, this would indicate that you're having the issue on a cluster which is populated with hosts. Are you able to run it again with verbose output and capture the output? Also, try using PowerShell 5.1, we don't officially support PowerShell 7 yet.

tpcarman commented 3 years ago

I've tested with PowerShell 7.1.2 in my lab and cannot reproduce the issue with an empty cluster. I've tested with all Admission Control settings.

Note: The vSphere report will fail on ESXi host reporting with PowerShell 7

image

tpcarman commented 2 years ago

As I have not had a response I will now close this issue. Please reopen this issue and provide more information if the problem persists.