Fortinet FortiGate As Built Report est un module PowerShell qui permet de générer une documentation sur la configuration de votre boiter FortiGate.
Exemple : Sample Fortinet FortiGate As-Built Report.html
# Generate a Fortinet FortiGate As Built Report for FortiGate fortigate.fortidemo.com using specified credentials. Export report to HTML & DOCX formats. Use default report style. Append timestamp to report filename. Save reports to 'C:\Users\PowerFGT\Documents'
PS C:\> New-AsBuiltReport -Report Fortinet.FortiGate -Target fortigate.fortidemo.com -Username demo -Password demo -Format Html,Word -OutputFolderPath 'C:\Users\PowerFGT\Documents' -Timestamp
# Generate a Fortinet FortiGate As Built Report for FortiGate fortigate.fortidemo.com using specified credentials and report configuration file. Export report to Text, HTML & DOCX formats. Use default report style. Save reports to 'C:\Users\PowerFGT\Documents'. Display verbose messages to the console.
PS C:\> New-AsBuiltReport -Report Fortinet.FortiGate -Target fortigate.fortidemo.com -Username demo -Password 'demo' -Format Text,Html,Word -OutputFolderPath 'C:\Users\PowerFGT\Documents' -ReportConfigFilePath 'C:\Users\Jon\AsBuiltReport\AsBuiltReport.Fortinet.FortiGate.json' -Verbose
# Generate a Fortinet FortiGate As Built Report for FortiGate fortigate.fortidemo.com using stored credentials. Export report to HTML & Text formats. Use default report style. Highlight environment issues within the report. Save reports to 'C:\Users\PowerFGT\Documents'.
PS C:\> $Creds = Get-Credential
PS C:\> New-AsBuiltReport -Report Fortinet.FortiGate -Target fortigate.fortidemo.com -Credential $Creds -Format Html,Text -OutputFolderPath 'C:\Users\PowerFGT\Documents' -EnableHealthCheck
# Generate a Fortinet FortiGate As Built Report for FortiGate fortigate.fortidemo.com using stored credentials. Export report to HTML & DOCX formats. Use default report style. Reports are saved to the user profile folder by default. Attach and send reports via e-mail.
PS C:\> New-AsBuiltReport -Report Fortinet.FortiGate -Target fortigate.fortidemo.com-Username demo -Password 'demo' -Format Html,Word -OutputFolderPath 'C:\Users\PowerFGT\Documents' -SendEmail
Prérequis :

PowerShell :
Windows PowerShell 5.1
PowerShell 7

Linux & MacOS :
.NET Core for MacOS
.NET Core for Linux
Procédure d'installation :
Installation en ligne des modules nécessaires :
Taper les lignes suivantes sur PowerShell :
Install-Module -Name PScribo
Install-Module -Name AsBuiltReport.Core
Install-Module -Name AsBuiltReport.Fortinet.FortiGate
Install-Module -Name PowerFGT
Si l'installation en ligne ne fonctionne pas (voir message ci-dessous), procéder à une installation manuelle.

Installation manuelle des modules nécessaires :
Cliquer sur les liens ci-dessous, aller dans l'onglet "Manual Download" et cliquer sur "Download the raw nupkg file" :

Créer un dossier "Modules" sur votre "Bureau" et placer les fichiers dedans :

Lancer "PowerShell" en tant qu'administrateur :

Débloquer les packages (cette étape n'est pas forcement nécessaire) avec les commandes suivantes :
Unblock-File -Path C:\Users\@USER\Desktop\Modules\pscribo.0.10.0.nupkg
Unblock-File -Path C:\Users\@USER\Desktop\Modules\asbuiltreport.core.1.2.0.nupkg
Unblock-File -Path C:\Users\@USER\Desktop\Modules\asbuiltreport.fortinet.fortigate.0.1.1.nupkg
Unblock-File -Path C:\Users\@USER\Desktop\Modules\powerfgt.0.6.1.nupkg

Extraite le contenu de chaque archive dans le dossier "Modules" :

Renommer les dossiers en supprimant la version, comme ci-dessous :

Chercher l'emplacement des modules PowerShell, taper la commande suivante :
$env:PSModulePath
Plusieurs chemins existent, dans notre cas nous allons utiliser le chemin suivant :
C:\Windows\system32\WindowsPowerShell\v1.0\Modules

Déplacer les dossiers qui se trouvent dans le dossier "Modules" sur votre "Bureau" vers "C:\Windows\system32\WindowsPowerShell\v1.0\Modules" :

Importer les modules :
Import-Module pscribo
Import-Module asbuiltreport.core
Import-Module powerfgt
Import-Module asbuiltreport.fortinet.fortigate
Ne pas prendre en compte le message d'avertissement lors de l'import du module "powerfgt" :

Vérifier que les modules importés sont bien disponible via la commande suivante :
Get-Module –ListAvailable

Supprimer le dossier "Modules" sur votre "Bureau" qui contient les archives ".nupkg"
Procédure d'installation terminée, retourner au début de page pour tester "AsBuiltReport Fortinet FortiGate".
Aller maintenant ici https://github.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate pour connaitre les commandes disponibles.
Source :
https://github.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate
https://github.com/FortiPower/PowerFGT