Skip to content
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

You cannot call a method on a null-valued expression #50

Closed
3 tasks done
hophead84 opened this issue Aug 23, 2023 · 11 comments
Closed
3 tasks done

You cannot call a method on a null-valued expression #50

hophead84 opened this issue Aug 23, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@hophead84
Copy link

Bug description

Attempting to run the FortiGate AsBuiltReport against a Virtual FortiGate running FortiOS 7.0.12.

Would you like to save the As Built Report configuration file? (y/n): n
VERBOSE: As Built Report configuration file not saved.
VERBOSE: Config.Report.Author = smichie
VERBOSE: Config.UserFolder.Path =
VERBOSE: Config.Company.FullName =
VERBOSE: Config.Company.Contact =
VERBOSE: Config.Company.Phone =
VERBOSE: Config.Company.Email =
VERBOSE: Config.Company.ShortName =
VERBOSE: Config.Company.Address =
VERBOSE: Config.Email.Port =
VERBOSE: Config.Email.Credentials =
VERBOSE: Config.Email.Server =
VERBOSE: Config.Email.To =
VERBOSE: Config.Email.From =
VERBOSE: Config.Email.UseSSL =
VERBOSE: Config.Email.Body =
VERBOSE: Populating RepositorySourceLocation property for module AsBuiltReport.Fortinet.FortiGate.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.Fortinet.FortiGate\0.2.0\AsBuiltReport.Fortinet.FortiGate.psm1'.
VERBOSE: Loading AsBuiltReport.Fortinet.FortiGate report configuration file from path 'C:\temp\AsBuiltReport.Fortinet.FortiGate.json'.
VERBOSE: Setting report filename to 'Fortinet FortiGate As Built Report'.
VERBOSE: [ 21:35:27:325 ] [ Document ] - Document 'Fortinet FortiGate As Built Report' processing started.
VERBOSE: [ 21:35:27:341 ] [ Document ] - Executing report style script from path 'C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.Fortinet.FortiGate\0.2.0\AsBuiltReport.Fortinet.FortiGate.Style.ps
1'.
VERBOSE: [ 21:35:27:357 ] [ Document ] - Setting global document options.
VERBOSE: [ 21:35:27:368 ] [ Document ] - Enabling section/heading numbering.
VERBOSE: [ 21:35:27:368 ] [ Document ] - Setting default font(s) to 'Arial'.
VERBOSE: [ 21:35:27:368 ] [ Document ] - Setting page top margin to '25.05'mm.
VERBOSE: [ 21:35:27:368 ] [ Document ] - Setting page right margin to '25.05'mm.
VERBOSE: [ 21:35:27:368 ] [ Document ] - Setting page bottom margin to '25.05'mm.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting page left margin to '25.05'mm.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting page size to 'A4'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting page orientation to 'Portrait'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting page height to '297'mm.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting page width to '210'mm.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting document style 'Title'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting document style 'Title2'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting document style 'Title3'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting document style 'Heading1'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting document style 'Heading2'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting document style 'Heading3'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting document style 'Heading4'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting document style 'NOTOCHeading4'.
VERBOSE: [ 21:35:27:373 ] [ Document ] - Setting document style 'Heading5'.
VERBOSE: [ 21:35:27:386 ] [ Document ] - Setting document style 'NOTOCHeading5'.
VERBOSE: [ 21:35:27:386 ] [ Document ] - Setting document style 'Normal'.
VERBOSE: [ 21:35:27:389 ] [ Document ] - Setting document style 'Caption'.
VERBOSE: [ 21:35:27:393 ] [ Document ] - Setting document style 'Header'.
VERBOSE: [ 21:35:27:393 ] [ Document ] - Setting document style 'Footer'.
VERBOSE: [ 21:35:27:393 ] [ Document ] - Setting document style 'TOC'.
VERBOSE: [ 21:35:27:393 ] [ Document ] - Setting document style 'TableDefaultHeading'.
VERBOSE: [ 21:35:27:393 ] [ Document ] - Setting document style 'TableDefaultRow'.
VERBOSE: [ 21:35:27:393 ] [ Document ] - Setting document style 'Critical'.
VERBOSE: [ 21:35:27:393 ] [ Document ] - Setting document style 'Warning'.
VERBOSE: [ 21:35:27:393 ] [ Document ] - Setting document style 'Info'.
VERBOSE: [ 21:35:27:393 ] [ Document ] - Setting document style 'OK'.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Setting table style 'TableDefault'.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Setting table style 'Borderless'.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing document header started.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing paragraph 'Fortinet FortiGate As Built Report -[..]'.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing document header completed.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing document footer started.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing paragraph 'Page <!# PageNumber #!>'.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing document footer completed.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing blank line.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing paragraph 'Fortinet FortiGate As Built Report'.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing blank line.
VERBOSE: [ 21:35:27:404 ] [ Document ] - Processing table 'Cover Page'.
VERBOSE: [ 21:35:27:420 ] [ Document ] - Processing page break.
VERBOSE: [ 21:35:27:420 ] [ Document ] - Processing table of contents 'Table of Contents'.
VERBOSE: [ 21:35:27:420 ] [ Document ] - Processing page break.
VERBOSE: [ 21:35:27:605 ] [ Document ] - Connect to 20.213.106.xxx : FGVMAZ (FGTAZRW7YAHQTxxx)
VERBOSE: [ 21:35:27:620 ] [ Document ] - Processing section 'Implementation Report FGTAZRW7YAHQT9F1' started.
VERBOSE: [ 21:35:27:620 ] [ Document ] - Processing paragraph 'The following section provides a sum[..]'.
VERBOSE: [ 21:35:27:620 ] [ Document ] - Processing blank line.
VERBOSE: [ 21:35:27:620 ] [ Document ] - Discovering FortiCare settings information from 20.213.106.xxx.
VERBOSE: [ 21:35:27:687 ] [ Document ] - Processing section 'FortiCare' started.
VERBOSE: [ 21:35:27:687 ] [ Document ] - Processing paragraph 'The following section details FortiC[..]'.
VERBOSE: [ 21:35:27:687 ] [ Document ] - Processing blank line.
WARNING: [ 21:35:27:687 ] [ Document ] - You cannot call a method on a null-valued expression.
VERBOSE: [ 21:35:27:715 ] [ Document ] - Document 'Fortinet FortiGate As Built Report' processing completed.
VERBOSE: [ 21:35:27:730 ] [ Document ] - Total processing time '0.41' seconds.
New-AsBuiltReport : The property 'Number' cannot be found on this object. Verify that the property exists.
At line:1 char:1

  • New-AsBuiltReport -Report Fortinet.FortiGate -Target 20.213.106.xxx - ...
  • 
    

Command-line input

New-AsBuiltReport -Report Fortinet.FortiGate -Target 20.213.106.xxx -Username reader -Password 'xxx' -Format Text,Html,Word -OutputFolderPath 'c:\temp' -ReportConfigFilePath 'C:\temp\AsBuiltReport.Fortinet.FortiGate.json' -Verbose

Steps to reproduce

New-AsBuiltReport -Report Fortinet.FortiGate -Target 20.213.106.xxx -Username reader -Password 'xxx' -Format Text,Html,Word -OutputFolderPath 'c:\temp' -ReportConfigFilePath 'C:\temp\AsBuiltReport.Fortinet.FortiGate.json' -Verbose

Expected behaviour

Successful execution

Screenshots

No response

Operating System

Windows 11

PowerShell Version

PS C:\WINDOWS\system32> $PSVersionTable

Name Value


PSVersion 5.1.22621.1778
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.1778
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

PowerShell Modules

Name Version


AsBuiltReport.Core 1.3.0
AsBuiltReport.Fortinet.FortiGate 0.2.0
PowerFGT 0.7.0
PScribo 0.10.0

Additional Context

NA

Before submitting

@hophead84 hophead84 added the bug Something isn't working label Aug 23, 2023
@alagoutte
Copy link
Collaborator

Hi @hophead84,

the FW use the default port (433) for management ?

@alagoutte
Copy link
Collaborator

What rights do you have on reader account ?

@hophead84
Copy link
Author

hophead84 commented Aug 23, 2023 via email

@hophead84
Copy link
Author

hophead84 commented Aug 23, 2023 via email

@hophead84
Copy link
Author

hophead84 commented Aug 23, 2023 via email

@alagoutte
Copy link
Collaborator

Hi,

can you try using directly PowerFGT (and use Connect-fgt) the following cmdlet 👍

(Get-FGTMonitorLicenseStatus).forticare
Get-FGTMonitorSystemFirmware
Get-FGTMonitorSystemFirmware -upgrade_paths

@alagoutte
Copy link
Collaborator

@hophead84 any news ?

@hophead84
Copy link
Author

hophead84 commented Sep 1, 2023 via email

@hophead84
Copy link
Author

hophead84 commented Sep 1, 2023 via email

@alagoutte
Copy link
Collaborator

Ok, strange... can you try to update to 0.2.1 ?

@alagoutte
Copy link
Collaborator

any news ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants