ornulfn / PSFortigateParser

Parse and create CSV reports from a Fortigate configuration file
BSD 3-Clause "New" or "Revised" License
26 stars 5 forks source link

Can't run module #1

Open Victor833 opened 4 years ago

Victor833 commented 4 years ago

Hi there,

First of all, I would like to thank you for sharing this module with us.

I am having an issue trying to load the module. I have copied it to %programfiles%\WindowsPowerShell\Modules, but if I try to run the commands specified on readme.md file, I receive the error:

"The term 'New-PSFortigateReport' is not recognized as the name of a cmdlet"

Could you, please, help me with this?

ricewu2020 commented 4 years ago

Hi, @Victor833 , I also used the module provided by Rasli and successfully got one csv created. The others have problems. What I did is under powershell CLI:

  1. Download Powershell version 7.1
  2. Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  3. Import-Module XXX\PSFortigateParser.psd1
    //XXX is your own path with this .psd1 in
  4. $Config = New-PSFortigateReport -Params @('XXX\firewall.conf', [System.Text.Encoding]::UTF8) //XXX is your own path with "firewall.conf" in
  5. $Config.savePolicyReport('XXX\firewall-policy.csv') //I successfully created the "firewall-policy.csv".

However, for the rest of the commands, say, $Config.saveServiceReport('XXX\firewall-service.csv'), I got the result: ConvertTo-Csv: XXX\PSFortigateParser-master\PSFortigateParser.psm1:1804 Line | 1804 | ConvertTo-Csv -NoTypeInformation -Delimiter (Get-Culture) … | ~~~~~~~~~~~~~ | Cannot bind argument to parameter 'InputObject' because it is null.