Code Monkey home page Code Monkey logo

Comments (17)

EloiseJory avatar EloiseJory commented on June 3, 2024 1

No resolution yet @zpatrickson Was ok on vsphere 6.5 but won't work on 6.7 u2

from asbuiltreport.vmware.vsphere.

tpcarman avatar tpcarman commented on June 3, 2024

@EloiseJory you seem to be using the vSphere report module from my dev repo.

Have you tried using the module from PSGallery?

from asbuiltreport.vmware.vsphere.

EloiseJory avatar EloiseJory commented on June 3, 2024

Yes i initially tried the prod version and had these errors so thought I'd give the dev version a whirl..

from asbuiltreport.vmware.vsphere.

tpcarman avatar tpcarman commented on June 3, 2024

I would suggest that you set all InfoLevels to 0 and then gradually increase the InfoLevel, one section at a time to help isolate where you are having the issue.

from asbuiltreport.vmware.vsphere.

EloiseJory avatar EloiseJory commented on June 3, 2024

Running the report withInfolevel 0 on all settings, lets the script complete, but it doesnโ€™t output anything (As expected).

If Iset vCentre to 1, or 2, the script completes, and yields an empty report.

Setting InfoLevel to 3 for vCenter, as below, the report crashes, with the same error as before.

from asbuiltreport.vmware.vsphere.

ZJPat avatar ZJPat commented on June 3, 2024

I'm facing the exact same issue. Have you figured out a solution to this issue?

from asbuiltreport.vmware.vsphere.

tpcarman avatar tpcarman commented on June 3, 2024

Hi @zpatrickson are you able to provide some more information regarding your vSphere environment and the AsBuiltReport module versions? Do you have anything unusual or unique in your environment?

Would you be open to doing a webex (or similar) session to allow me to investigate further?

from asbuiltreport.vmware.vsphere.

ZJPat avatar ZJPat commented on June 3, 2024

Hi @tpcarman, sure we can do a webex. How can we proceed with troubleshooting the script? I'm using version 1.0.7 and reside in DC. Nothing unusual in my environment. My Vsphere is 5.5 and planning to do an upgrade. I just want to document it before hand.

from asbuiltreport.vmware.vsphere.

tpcarman avatar tpcarman commented on June 3, 2024

@zpatrickson I am in UTC +10 for the next 1.5 weeks. Late evening my time, early morning your time probably works best for me. We can either do webex or do LiveShare within VS Code. Let me know if this works for you.

from asbuiltreport.vmware.vsphere.

ZJPat avatar ZJPat commented on June 3, 2024

Webex works. I can do 10:00 PM, 11:00 PM or 12:00AM your time. If you can provide me with a contact info that would be helpful.

from asbuiltreport.vmware.vsphere.

tpcarman avatar tpcarman commented on June 3, 2024

@zpatrickson Send me your email address via the contact page.

from asbuiltreport.vmware.vsphere.

tpcarman avatar tpcarman commented on June 3, 2024

@zpatrickson @EloiseJory hi guys, would you mind connecting to your vCenter with PowerCLI and running the following;

$VMs = Get-VM
$VMInfo = foreach ($VM in $VMs) {
	$VMView = $VM | Get-View
	[PSCustomObject]@{
		'Name' = $VM.Name
		'Power State' = Switch ($VM.PowerState) {
			'PoweredOn' { 'On' }
			'PoweredOff' { 'Off' }
			default { $VM.PowerState }
		}
		'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
			$null { '--' }
			default { $VMView.Summary.Guest.IpAddress }
		}
		'vCPUs' = $VM.NumCpu
		'Memory GB' = [math]::Round(($VM.MemoryGB), 0)
		'Provisioned GB' = [math]::Round(($VM.ProvisionedSpaceGB), 0)
		'Used GB' = [math]::Round(($VM.UsedSpaceGB), 0)
		'HW Version' = ($VM.HardwareVersion).Replace('vmx-', 'v')
		'VM Tools Status' = Switch ($VMView.Summary.Guest.ToolsStatus) {
			'toolsOld' { 'Old' }
			'toolsOK' { 'OK' }
			'toolsNotRunning' { 'Not Running' }
			'toolsNotInstalled' { 'Not Installed' }
			default { $VMView.Guest.ToolsStatus }
		}         
	}
}
Write-Output $VMInfo | ft

Please let me know how this goes.

from asbuiltreport.vmware.vsphere.

EloiseJory avatar EloiseJory commented on June 3, 2024

@zpatrickson @EloiseJory hi guys, would you mind connecting to your vCenter with PowerCLI and running the following;

I should be able to test it tomorrow - will let you know !!

thanks

Eloise.

from asbuiltreport.vmware.vsphere.

EloiseJory avatar EloiseJory commented on June 3, 2024

Hi
All I get is errors:

You cannot call a method on a null-valued expression.
`At line:11 char:26

  •     'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
    
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:11 char:26

  •     'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
    
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:11 char:26

  •     'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
    
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:11 char:26

  •     'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
    
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:11 char:26

  •     'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
    
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:11 char:26

  •     'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
    
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull
      `

from asbuiltreport.vmware.vsphere.

tpcarman avatar tpcarman commented on June 3, 2024

What about this?

$VMs = Get-VM
$VMInfo = foreach ($VM in $VMs) {
	$VMView = $VM | Get-View
	[PSCustomObject]@{
		'Name' = $VM.Name
		'Power State' = Switch ($VM.PowerState) {
			'PoweredOn' { 'On' }
			'PoweredOff' { 'Off' }
			default { $VM.PowerState }
		}
		'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
			$null { '--' }
                        '' { '--' }
			default { $VMView.Summary.Guest.IpAddress }
		}
		'vCPUs' = $VM.NumCpu
		'Memory GB' = [math]::Round(($VM.MemoryGB), 0)
		'Provisioned GB' = [math]::Round(($VM.ProvisionedSpaceGB), 0)
		'Used GB' = [math]::Round(($VM.UsedSpaceGB), 0)
		'HW Version' = ($VM.HardwareVersion).Replace('vmx-', 'v')
		'VM Tools Status' = Switch ($VMView.Summary.Guest.ToolsStatus) {
			'toolsOld' { 'Old' }
			'toolsOK' { 'OK' }
			'toolsNotRunning' { 'Not Running' }
			'toolsNotInstalled' { 'Not Installed' }
			default { $VMView.Guest.ToolsStatus }
		}         
	}
}
Write-Output $VMInfo | ft

If that still doesn't work, try removing these lines and trying again

'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
			$null { '--' }
                        '' { '--' }
			default { $VMView.Summary.Guest.IpAddress }
		}

from asbuiltreport.vmware.vsphere.

EloiseJory avatar EloiseJory commented on June 3, 2024

What about this?
First attempt was a heap of these again

`You cannot call a method on a null-valued expression.
At line:11 char:26

  •     'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
    
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:11 char:26

  •     'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
    
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:11 char:26

  •     'IP Address' = Switch ($VMView.Summary.Guest.IpAddress) {
    
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull`

second attempt with the IP code removed was

`You cannot call a method on a null-valued expression.
At line:6 char:27

  •     'Power State' = Switch ($VM.PowerState) {
    
  •                             ~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:6 char:27

  •     'Power State' = Switch ($VM.PowerState) {
    
  •                             ~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:6 char:27

  •     'Power State' = Switch ($VM.PowerState) {
    
  •                             ~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull`

from asbuiltreport.vmware.vsphere.

tpcarman avatar tpcarman commented on June 3, 2024

This issue should be resolved in 5a2992c. Please reopen if you continue to experience issues.

from asbuiltreport.vmware.vsphere.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.