Skip to content

Commit 4c58d89

Browse files
committed
System: Add try/catch for HA Peer / Checksum
it is not supported with old FortiOS (before 7.0.x)
1 parent 8f1c58a commit 4c58d89

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Src/Private/Get-AbrFgtSystem.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,12 @@ function Get-AbrFgtSystem {
627627

628628
# Fetch HA Configuration
629629
$haConfig = Get-FGTSystemHA
630-
$haPeers = Get-FGTMonitorSystemHAPeer
631-
$haChecksums = Get-FGTMonitorSystemHAChecksum
630+
try {
631+
$haPeers = Get-FGTMonitorSystemHAPeer
632+
$haChecksums = Get-FGTMonitorSystemHAChecksum
633+
} catch {
634+
Write-Warning "HA Peer/Checksum are not available before FortiOS 6.2.x"
635+
}
632636

633637
if ( $haConfig.mode -ne 'standalone' -and $infoLevel.System -ge 1) {
634638
Section -Style Heading3 'High Availability' {

0 commit comments

Comments
 (0)