AsBuiltReport / AsBuiltReport.Fortinet.FortiGate

Repository for AsBuiltReport Fortinet FortiGate module
MIT License
37 stars 12 forks source link

Cannot validate argument on parameter 'Hashtable'. #63

Closed connorhess closed 8 months ago

connorhess commented 8 months ago

Bug description

we are running fortigate version 7.4.1 and getting the following error. I have done tests and put together a whole document testing the different versions for the company i work for. i will attach that document. but we have noted at one of our clients that it does not work on their 7.4.1.

Command-line input

$Username = 'Redacted'\n$Password_un = 'Redacted'\n$Server = 'Redacted'\n$Port = Redacted\n\n$password = ConvertTo-SecureString $Password_un -AsPlainText -Force\n\nConnect-FGT -Server $Server -Username $Username -Password $password -Port $Port -SkipCertificateCheck\n\nNew-AsBuiltReport -Report Fortinet.FortiGate -Target $Server -Username $Username -Password $Password_un -Format Word -OutputFolderPath 'C:\AsBuilt' -Timestamp -ReportConfigFilePath 'C:\AsBuilt\AsBuilt.json' -AsBuiltConfigFilePath 'C:\AsBuilt\parameters.json' -StyleFilePath 'C:\AsBuilt\StyleFilePath.ps1' -Filename '[Redacted] Fortinet FortiGate As Built Report (fmDQ)'

Steps to reproduce

FortiGate As-Built Program Debug 2.docx

Expected behaviour

As Built to be generated

Screenshots

No response

Operating System

Windows 11

PowerShell Version

Name Value


PSVersion 5.1.22621.2506 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.22621.2506 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.2 PowerFGT 0.7.0 PScribo 0.10.0

Additional Context

Redacted Logging.log

Before submitting

alagoutte commented 8 months ago

Hi Connor(Hess)

Can you enable report with -verbose and attach the output ?

i will for try to look for reproducte

connorhess commented 8 months ago

ok will attach now

connorhess commented 8 months ago

Just in a meeting quick. will run the command with -verbose sometime in the meeting when i get a chance.

connorhess commented 8 months ago
WARNING: The names of some imported commands from the module 'PowerFGT' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.

Name                           Value
----                           -----
server                         **Redacted**
version                        7.4.1
invokeParams                   {UseBasicParsing, DisableKeepAlive, TimeoutSec}
headers                        {X-CSRFTOKEN}
port                           **Redacted**
httpOnly                       False
session                        Microsoft.PowerShell.Commands.WebRequestSession
serial                         **Redacted**
vdom
VERBOSE: Loading As Built Report configuration from 'C:\AsBuilt\parameters.json'.
VERBOSE: Populating RepositorySourceLocation property for module AsBuiltReport.Fortinet.FortiGate.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.Fortinet.FortiGate\0.2.2\AsBuiltReport.Fortinet.FortiGate.psm1'.
VERBOSE: Loading AsBuiltReport.Fortinet.FortiGate report configuration file from path 'C:\AsBuilt\AsBuilt.json'.
VERBOSE: Setting report filename to '[**Redacted**][V0.1] Fortinet FortiGate As Built Report (S8VM) - 2024-01-15_11.04.39'.
VERBOSE: [ 11:04:39:297 ] [ Document ] - Document '[**Redacted**][V0.1] Fortinet FortiGate As Built Report (S8VM) - 2024-01-15_11.04.39' processing started.
VERBOSE: [ 11:04:39:539 ] [ Document ] - Executing report style script from path 'C:\AsBuilt\StyleFilePath.ps1'.
VERBOSE: [ 11:04:39:586 ] [ Document ] - Setting global document options.
VERBOSE: [ 11:04:39:589 ] [ Document ] - Enabling section/heading numbering.
VERBOSE: [ 11:04:39:597 ] [ Document ] - Setting default font(s) to 'Arial'.
VERBOSE: [ 11:04:39:599 ] [ Document ] - Setting page top margin to '25.05'mm.
VERBOSE: [ 11:04:39:601 ] [ Document ] - Setting page right margin to '25.05'mm.
VERBOSE: [ 11:04:39:603 ] [ Document ] - Setting page bottom margin to '25.05'mm.
VERBOSE: [ 11:04:39:605 ] [ Document ] - Setting page left margin to '25.05'mm.
VERBOSE: [ 11:04:39:607 ] [ Document ] - Setting page size to 'A4'.
VERBOSE: [ 11:04:39:609 ] [ Document ] - Setting page orientation to 'Portrait'.
VERBOSE: [ 11:04:39:611 ] [ Document ] - Setting page height to '297'mm.
VERBOSE: [ 11:04:39:613 ] [ Document ] - Setting page width to '210'mm.
VERBOSE: [ 11:04:39:615 ] [ Document ] - Setting document style 'Title'.
VERBOSE: [ 11:04:39:618 ] [ Document ] - Setting document style 'Title2'.
VERBOSE: [ 11:04:39:623 ] [ Document ] - Setting document style 'Title3'.
VERBOSE: [ 11:04:39:627 ] [ Document ] - Setting document style 'Heading1'.
VERBOSE: [ 11:04:39:649 ] [ Document ] - Setting document style 'Heading2'.
VERBOSE: [ 11:04:39:654 ] [ Document ] - Setting document style 'Heading3'.
VERBOSE: [ 11:04:39:657 ] [ Document ] - Setting document style 'Heading4'.
VERBOSE: [ 11:04:39:661 ] [ Document ] - Setting document style 'NOTOCHeading4'.
VERBOSE: [ 11:04:39:664 ] [ Document ] - Setting document style 'Heading5'.
VERBOSE: [ 11:04:39:669 ] [ Document ] - Setting document style 'NOTOCHeading5'.
VERBOSE: [ 11:04:39:672 ] [ Document ] - Setting document style 'Normal'.
VERBOSE: [ 11:04:39:674 ] [ Document ] - Setting document style 'Caption'.
VERBOSE: [ 11:04:39:678 ] [ Document ] - Setting document style 'Header'.
VERBOSE: [ 11:04:39:680 ] [ Document ] - Setting document style 'Footer'.
VERBOSE: [ 11:04:39:684 ] [ Document ] - Setting document style 'TOC'.
VERBOSE: [ 11:04:39:687 ] [ Document ] - Setting document style 'TableDefaultHeading'.
VERBOSE: [ 11:04:39:692 ] [ Document ] - Setting document style 'TableDefaultRow'.
VERBOSE: [ 11:04:39:696 ] [ Document ] - Setting document style 'Critical'.
VERBOSE: [ 11:04:39:700 ] [ Document ] - Setting document style 'Warning'.
VERBOSE: [ 11:04:39:705 ] [ Document ] - Setting document style 'Info'.
VERBOSE: [ 11:04:39:710 ] [ Document ] - Setting document style 'OK'.
VERBOSE: [ 11:04:39:715 ] [ Document ] - Setting table style 'TableDefault'.
VERBOSE: [ 11:04:39:720 ] [ Document ] - Setting table style 'Borderless'.
VERBOSE: [ 11:04:39:740 ] [ Document ] - Processing document header started.
VERBOSE: [ 11:04:39:805 ] [ Document ] - Processing paragraph 'Fortinet FortiGate As Built Report -[..]'.
VERBOSE: [ 11:04:39:865 ] [ Document ] - Processing document header completed.
VERBOSE: [ 11:04:39:870 ] [ Document ] - Processing document footer started.
VERBOSE: [ 11:04:39:887 ] [ Document ] - Processing paragraph 'Page <!# PageNumber #!>'.
VERBOSE: [ 11:04:39:895 ] [ Document ] - Processing document footer completed.
VERBOSE: [ 11:04:39:902 ] [ Document ] - Processing blank line.
VERBOSE: [ 11:04:39:905 ] [ Document ] - Processing paragraph 'Fortinet FortiGate As Built Report'.
VERBOSE: [ 11:04:39:911 ] [ Document ] - Processing blank line.
VERBOSE: [ 11:04:39:913 ] [ Document ] - Processing paragraph '**Redacted**'.
VERBOSE: [ 11:04:39:916 ] [ Document ] - Processing blank line.
VERBOSE: [ 11:04:39:939 ] [ Document ] - Processing table 'Cover Page'.
VERBOSE: [ 11:04:39:985 ] [ Document ] - Processing page break.
VERBOSE: [ 11:04:39:991 ] [ Document ] - Processing table of contents 'Table of Contents'.
VERBOSE: [ 11:04:39:995 ] [ Document ] - Processing page break.
VERBOSE: [ 11:04:40:940 ] [ Document ] - Connect to **Redacted** : FG101F (**Redacted**)
VERBOSE: [ 11:04:40:952 ] [ Document ] - Processing section 'Implementation Report **Redacted**' started.
VERBOSE: [ 11:04:40:980 ] [ Document ] - Processing paragraph 'The following section provides a sum[..]'.
VERBOSE: [ 11:04:40:983 ] [ Document ] - Processing blank line.
VERBOSE: [ 11:04:40:993 ] [ Document ] - Discovering FortiCare settings information from **Redacted**.
VERBOSE: [ 11:04:41:117 ] [ Document ] - Processing section 'FortiCare' started.
VERBOSE: [ 11:04:41:145 ] [ Document ] - Processing paragraph 'The following section details FortiC[..]'.
VERBOSE: [ 11:04:41:148 ] [ Document ] - Processing blank line.
VERBOSE: [ 11:04:41:164 ] [ Document ] - Processing table 'FortiCare'.
VERBOSE: [ 11:04:41:212 ] [ Document ] - Processing paragraph 'The following section details suppor[..]'.
VERBOSE: [ 11:04:41:216 ] [ Document ] - Processing blank line.
VERBOSE: [ 11:04:41:232 ] [ Document ] - Processing table 'Support'.
VERBOSE: [ 11:04:41:247 ] [ Document ] - Processing section 'FortiCare' completed.
VERBOSE: [ 11:04:41:507 ] [ Document ] - Processing paragraph 'The following section details firmwa[..]'.
VERBOSE: [ 11:04:41:509 ] [ Document ] - Processing blank line.
VERBOSE: [ 11:04:41:540 ] [ Document ] - Processing table 'Firmware'.
WARNING: [ 11:04:41:708 ] [ Document ] - Cannot bind argument to parameter 'Rows' because it is an empty collection.
VERBOSE: [ 11:04:41:826 ] [ Document ] - Document '[**Redacted**][V0.1] Fortinet FortiGate As Built Report (S8VM) - 2024-01-15_11.04.39' processing completed.
VERBOSE: [ 11:04:41:834 ] [ Document ] - Total processing time '2.63' seconds.
Fortinet FortiGate As Built Report '[**Redacted**][V0.1] Fortinet FortiGate As Built Report (S8VM) - 2024-01-15_11.04.39' has been saved to 'C:\AsBuilt'.

[ERROR] - Table : Cannot validate argument on parameter 'Hashtable'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.Fortinet.FortiGate\0.2.2\Src\Private\Get-AbrFgtFortiCare.ps1:187 char:32
+             $tab_upgradePath | Table @TableParams
+                                ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Table], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Table
alagoutte commented 8 months ago

Ok, i have reproduce the issue (with 7.4.0), i will look for a fix

alagoutte commented 8 months ago

i push a fix https://github.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate/pull/64 if you want to try

connorhess commented 8 months ago

I will need to do that tomorrow, I am out of the office now👍 will pull and try first thing in the morning. On 15 Jan 2024, at 15:16, Alexis La Goutte @.***> wrote: i push a fix #64 if you want to try

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

alagoutte commented 8 months ago

it is good ?

connorhess commented 8 months ago

I am not very proficient with ps scripts, is it possible to get a reference to a guide on how to update the package to this version?