-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New-AsBuiltReport : You cannot call a method on a null-valued expression. #19
Comments
If I disable the SRM license check portion the report runs fine. Lol this happens to be the thing I was most concerned about of course. |
Does this module gather the SRM lic information by this command Get-AbrSRMLicense ? or is that an alias you created? |
I tested the report in two different SRM environments and could not replicate the error you report. Can you run the following commands and send me the results? Be sure to hide the private information.
|
Yes I can thank you for the response I will plan to test today. |
PS C:\Users\username > $LocalvCenter = Connect-VIServer -Server "servername" -Credential $Cred -ErrorAction Stop PS C:\Users\username > $LocalSRM = Connect-SrmServer -IgnoreCertificateErrors -Verbose -Debug -Server $LocalvCenter -Credential $cred -Port 443 -Protocol https -RemoteCredential $cred PS C:\Users\username > $RemotevCenter = Connect-VIServer $LocalSRM.ExtensionData.GetPairedSite().vcHost -Credential $Cred -ErrorAction Stop
PS C:\Users\username > $RemoteSRM = Connect-SrmServer -IgnoreCertificateErrors -Server $RemotevCenter -Credential $Cred -Port 443 -Protocol https -RemoteCredential $Cred PS C:\Users\username > $LocalSRM.ExtensionData.GetLicenseInfo()
PS C:\Users\username > $RemoteSRM.ExtensionData.GetLicenseInfo()
|
hey guys, i think the issue here is here if ($LocalLicenseInfo) { if ($RemoteLicenseInfo) { in the Get-ABRSRMLicense.ps1 ** i haven't tested yet, but i had the same error and i can't find a reference anywhere else to $licenseInfo |
Code has been added that possibly fixes this issue. Please upgrade to the latest version of the report.
|
Bug description
I was able to run a few reports without issue. For what seems to be no reason the command to run the report errors out with
New-AsBuiltReport : You cannot call a method on a null-valued expression. and it points to the first line of the command to call the report example New-AsBuiltReport -Report VMware.SRM -Target 192.168.5.16 -Credential $Creds -Format Html,Text -OutputFolderPath 'C:\Users\Jon\Documents' -EnableHealthCheck the error would point to the first char at this line.
When I run the command verbose it successfully connects to the vcenter and gets to the point where is obtaining SRM licensing information. The command then stops with the provided error message.
Command-line input
New-AsBuiltReport -Report VMware.SRM -Target 192.168.5.16 -Credential $Creds -Format Html,Text -OutputFolderPath 'C:\Users\Jon\Documents'
Steps to reproduce
1.) run the cmdlet New-AsBuiltReport -Report VMware.SRM -Target 192.168.5.16 -Credential $Creds -Format Html,Text -OutputFolderPath 'C:\Users\Jon\Documents'
Expected behaviour
I expected the cmdlet to run without error and output my report successfully to the given output folder.
Screenshots
No response
Operating System
Windows Server 2012R2
PowerShell Version
5.1
PowerShell Modules
AsBuiltReport.Core 1.3.0
AsBuiltReport.VMware.SRM 0.4.2
PScribo 0.10.0
Additional Context
No response
Before submitting
The text was updated successfully, but these errors were encountered: