Skip to content

Commit 947a82a

Browse files
committed
System: Fix support when use PS 5
1 parent 57b2a84 commit 947a82a

File tree

2 files changed

+90
-97
lines changed

2 files changed

+90
-97
lines changed

Src/Private/Get-AbrFgtFortiCare.ps1

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -30,59 +30,59 @@ function Get-AbrFgtForticare {
3030
if ($LicenseStatus -and $InfoLevel.Forticare -ge 1) {
3131

3232
$FortiGuardservicesDescriptions = @{
33-
"forticare" = "FortiCare Support Services"
34-
"forticloud" = "FortiCloud Management"
35-
"security_rating" = "Security Fabric Rating and Compliance Service"
36-
"antivirus" = "Antivirus Service"
37-
"mobile_malware" = "Mobile Malware Service"
38-
"ai_malware_detection" = "AI-based Inline Malware Prevention"
39-
"ips" = "Intrusion Prevention System (IPS)"
40-
"industrial_db" = "OT Industrial Signatures Database"
41-
"appctrl" = "Application Control"
42-
"internet_service_db" = "Internet Service (SaaS) Database"
43-
"device_os_id" = "Device/OS Detection"
44-
"botnet_ip" = "Botnet IP Reputation Service"
45-
"botnet_domain" = "Botnet Domain Reputation Service"
46-
"psirt_security_rating" = "Attack Surface Security Rating"
47-
"outbreak_security_rating" = "Outbreak Security Rating Service"
48-
"icdb" = "OT Industrial Signatures Database"
49-
"inline_casb" = "Inline SaaS Application Security (CASB)"
50-
"local_in_virtual_patching" = "OT Virtual Patching"
51-
"malicious_urls" = "Malicious URL Database"
52-
"blacklisted_certificates" = "Blacklisted Certificates Service"
53-
"firmware_updates" = "Firmware Updates"
54-
"web_filtering" = "Web Filtering Service"
55-
"outbreak_prevention" = "Outbreak Prevention"
56-
"antispam" = "Antispam Service"
57-
"iot_detection" = "IoT Detection Service"
58-
"ot_detection" = "OT Detection Service"
59-
"forticloud_sandbox" = "FortiCloud Sandbox"
60-
"forticonverter" = "FortiConverter Service"
61-
"fortiguard" = "FortiGuard Services"
62-
"data_leak_prevention" = "Data Leak Prevention"
63-
"sdwan_network_monitor" = "SD-WAN Network Monitor"
64-
"forticloud_logging" = "FortiCloud Logging"
65-
"fortianalyzer_cloud" = "FortiAnalyzer Cloud"
33+
"forticare" = "FortiCare Support Services"
34+
"forticloud" = "FortiCloud Management"
35+
"security_rating" = "Security Fabric Rating and Compliance Service"
36+
"antivirus" = "Antivirus Service"
37+
"mobile_malware" = "Mobile Malware Service"
38+
"ai_malware_detection" = "AI-based Inline Malware Prevention"
39+
"ips" = "Intrusion Prevention System (IPS)"
40+
"industrial_db" = "OT Industrial Signatures Database"
41+
"appctrl" = "Application Control"
42+
"internet_service_db" = "Internet Service (SaaS) Database"
43+
"device_os_id" = "Device/OS Detection"
44+
"botnet_ip" = "Botnet IP Reputation Service"
45+
"botnet_domain" = "Botnet Domain Reputation Service"
46+
"psirt_security_rating" = "Attack Surface Security Rating"
47+
"outbreak_security_rating" = "Outbreak Security Rating Service"
48+
"icdb" = "OT Industrial Signatures Database"
49+
"inline_casb" = "Inline SaaS Application Security (CASB)"
50+
"local_in_virtual_patching" = "OT Virtual Patching"
51+
"malicious_urls" = "Malicious URL Database"
52+
"blacklisted_certificates" = "Blacklisted Certificates Service"
53+
"firmware_updates" = "Firmware Updates"
54+
"web_filtering" = "Web Filtering Service"
55+
"outbreak_prevention" = "Outbreak Prevention"
56+
"antispam" = "Antispam Service"
57+
"iot_detection" = "IoT Detection Service"
58+
"ot_detection" = "OT Detection Service"
59+
"forticloud_sandbox" = "FortiCloud Sandbox"
60+
"forticonverter" = "FortiConverter Service"
61+
"fortiguard" = "FortiGuard Services"
62+
"data_leak_prevention" = "Data Leak Prevention"
63+
"sdwan_network_monitor" = "SD-WAN Network Monitor"
64+
"forticloud_logging" = "FortiCloud Logging"
65+
"fortianalyzer_cloud" = "FortiAnalyzer Cloud"
6666
"fortianalyzer_cloud_premium" = "FortiAnalyzer Cloud Premium"
67-
"fortimanager_cloud" = "FortiManager Cloud"
68-
"fortisandbox_cloud" = "FortiSandbox Cloud"
67+
"fortimanager_cloud" = "FortiManager Cloud"
68+
"fortisandbox_cloud" = "FortiSandbox Cloud"
6969
"fortiguard_ai_based_sandbox" = "FortiGuard AI-based Sandbox"
70-
"sdwan_overlay_aas" = "SD-WAN Overlay-as-a-Service"
71-
"fortisase_private_access" = "FortiSASE Private Access"
72-
"fortisase_lan_extension" = "FortiSASE LAN Extension"
73-
"fortiems_cloud" = "FortiEMS Cloud"
74-
"fortimanager_cloud_alci" = "FortiManager Cloud ALCI"
75-
"fortisandbox_cloud_alci" = "FortiSandbox Cloud ALCI"
76-
"vdom" = "Virtual Domains (platform capability)"
77-
"sms" = "SMS Service"
70+
"sdwan_overlay_aas" = "SD-WAN Overlay-as-a-Service"
71+
"fortisase_private_access" = "FortiSASE Private Access"
72+
"fortisase_lan_extension" = "FortiSASE LAN Extension"
73+
"fortiems_cloud" = "FortiEMS Cloud"
74+
"fortimanager_cloud_alci" = "FortiManager Cloud ALCI"
75+
"fortisandbox_cloud_alci" = "FortiSandbox Cloud ALCI"
76+
"vdom" = "Virtual Domains (platform capability)"
77+
"sms" = "SMS Service"
7878
}
7979
$licenseSummary = @()
8080

8181
$typeDescriptions = @{
82-
downloaded_fds_object = 'Update Feed'
82+
downloaded_fds_object = 'Update Feed'
8383
live_fortiguard_service = 'Real-time Services'
84-
live_cloud_service = 'Cloud Services'
85-
functionality_enabling = 'Feature'
84+
live_cloud_service = 'Cloud Services'
85+
functionality_enabling = 'Feature'
8686
}
8787

8888
$excludeServices = @(
@@ -123,13 +123,13 @@ function Get-AbrFgtForticare {
123123
$typeDescription = $typeDescriptions[$type]
124124

125125
$licenseSummaryUnordered += [PSCustomObject]@{
126-
name = $property.Name
127-
description = $description
128-
status = $status
129-
expiration = $expires
130-
type = $type
126+
name = $property.Name
127+
description = $description
128+
status = $status
129+
expiration = $expires
130+
type = $type
131131
typeDescription = $typeDescription
132-
entitlement = $entitlement
132+
entitlement = $entitlement
133133
}
134134
}
135135

@@ -149,16 +149,16 @@ function Get-AbrFgtForticare {
149149
$Serial = $DefaultFGTConnection.serial
150150

151151
$OutObj = [pscustomobject]@{
152-
"Model" = $Model
153-
"Serial" = $Serial
154-
"Status" = $Forticare.status
152+
"Model" = $Model
153+
"Serial" = $Serial
154+
"Status" = $Forticare.status
155155
"Account" = $Forticare.account
156156
"Company" = $Forticare.company
157157
}
158158

159159
$TableParams = @{
160-
Name = "FortiCare"
161-
List = $true
160+
Name = "FortiCare"
161+
List = $true
162162
ColumnWidths = 50, 50
163163
}
164164

@@ -180,16 +180,16 @@ function Get-AbrFgtForticare {
180180
$licenseStatus = 'Unlicensed'
181181
}
182182
$OutObj += [pscustomobject]@{
183-
"Name" = $license.description
184-
"Type" = $license.typeDescription
185-
"Status" = $licenseStatus
183+
"Name" = $license.description
184+
"Type" = $license.typeDescription
185+
"Status" = $licenseStatus
186186
"Expiration" = $license.expiration
187187
}
188188
}
189189

190190
$TableParams = @{
191-
Name = "FortiGuard Services"
192-
List = $false
191+
Name = "FortiGuard Services"
192+
List = $false
193193
ColumnWidths = 50, 20, 15, 15
194194
}
195195

@@ -204,22 +204,22 @@ function Get-AbrFgtForticare {
204204
BlankLine
205205
$ExpiresHW = $Forticare.support.hardware.expires
206206
$SupportHW = [pscustomobject]@{
207-
"Type" = "Hardware"
208-
"Level" = $Forticare.support.hardware.support_level
209-
"Status" = $Forticare.support.hardware.status
207+
"Type" = "Hardware"
208+
"Level" = $Forticare.support.hardware.support_level
209+
"Status" = $Forticare.support.hardware.status
210210
"Expiration Date" = (Get-Date 01.01.1970) + ([System.TimeSpan]::fromseconds($ExpiresHW)) | Get-Date -Format dd/MM/yyyy
211211
}
212212
$ExpiresEn = $Forticare.support.enhanced.expires
213213
$SupportEn = [pscustomobject]@{
214-
"Type" = "Enhanced"
215-
"Level" = $Forticare.support.enhanced.support_level
216-
"Status" = $Forticare.support.enhanced.status
214+
"Type" = "Enhanced"
215+
"Level" = $Forticare.support.enhanced.support_level
216+
"Status" = $Forticare.support.enhanced.status
217217
"Expiration Date" = (Get-Date 01.01.1970) + ([System.TimeSpan]::fromseconds($ExpiresEn)) | Get-Date -Format dd/MM/yyyy
218218
}
219219

220220
$TableParams = @{
221-
Name = "Support"
222-
List = $false
221+
Name = "Support"
222+
List = $false
223223
ColumnWidths = 25, 25, 25, 25
224224
}
225225

@@ -258,8 +258,8 @@ function Get-AbrFgtForticare {
258258
#Same (or greater) version, No Update Available
259259
if ($CurrentVersion -ge $FullUpdateVersion) {
260260
$tab_upgradePath = [pscustomobject]@{
261-
"Installed" = $($FortiOS.version)
262-
"Update" = "No Update Available"
261+
"Installed" = $($FortiOS.version)
262+
"Update" = "No Update Available"
263263
"Upgrade Path" = "N/A"
264264
}
265265
} else {
@@ -298,8 +298,8 @@ function Get-AbrFgtForticare {
298298
$upgradePath = $upgradePath + " -> v$($major).$($minor).$($patch)"
299299
}Until($major -eq $FullUpdateVersion.Major -and $minor -eq $FullUpdateVersion.Minor -and $patch -eq $FullUpdateVersion.Build)
300300
$tab_upgradePath = [pscustomobject]@{
301-
"Installed" = $($FortiOS.version)
302-
"Update" = $($FullUpdate.version)
301+
"Installed" = $($FortiOS.version)
302+
"Update" = $($FullUpdate.version)
303303
"Upgrade Path" = $upgradePath
304304
}
305305
#}
@@ -308,15 +308,15 @@ function Get-AbrFgtForticare {
308308

309309
#No $firmware.available info (no FortiCare/FortiGuard ?)
310310
$tab_upgradePath = [pscustomobject]@{
311-
"Installed" = $($FortiOS.version)
312-
"Update" = "N/A"
311+
"Installed" = $($FortiOS.version)
312+
"Update" = "N/A"
313313
"Upgrade Path" = "N/A"
314314
}
315315
}
316316

317317
$TableParams = @{
318-
Name = "Firmware"
319-
List = $true
318+
Name = "Firmware"
319+
List = $true
320320
ColumnWidths = 50, 50
321321
}
322322

Src/Private/Get-AbrFgtSystem.ps1

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -263,25 +263,18 @@ function Get-AbrFgtSystem {
263263
foreach ($interface in $group.Group) {
264264

265265
# Standardise interface properties
266-
$interface.name = $interface.name + $($interface.alias ? "`n($($interface.alias))" : "")
267-
$interface.role = $interface.role -eq 'undefined' ? "" : ($interface.role).ToUpper()
268-
$interface.member = $interface.member.count -gt 0 ? $interface.member.'interface-name' -join ', ' : ""
269-
$interface.mtu = $interface.'mtu-override' -eq 'disable' ? '' : $interface.mtu
270-
$interface.mode = $interface.mode -eq 'static' ? '' : $interface.mode
271-
$interface.ip = $interface.ip -eq '0.0.0.0 0.0.0.0' ? '' : $(if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $interface.ip } else { $interface.ip })
272-
$interface.'secondaryip' = if ($interface.'secondary-ip' -eq 'enable' -and $null -ne $interface.'secondaryip') {
273-
($interface.'secondaryip' | ForEach-Object {
274-
$(if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $_.ip } else { $_.ip })
275-
}) -join ', '
276-
} else {
277-
""
278-
}
279-
$interface.mode = $interface.mode -eq 'static' ? '' : $interface.mode
280-
$interface.vdom = $interface.vdom -eq 'root' ? '' : $interface.vdom
281-
$interface.vlanid = ($interface.vlanid -gt 0 ) ? $interface.vlanid : ""
282-
$interface.speed = $interface.speed -eq 'auto' ? '' : $interface.speed
283-
$interface.'remote-ip' = $interface.'remote-ip' -eq '0.0.0.0 0.0.0.0' ? '' : $(if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $interface.'remote-ip' } else { $interface.'remote-ip' })
284-
266+
if ($interface.alias) { $interface.name = $interface.name + "`n($($interface.alias))" }
267+
$interface.role = if ($interface.role -eq 'undefined') { "" } else { ($interface.role).ToUpper() }
268+
$interface.member = if ($interface.member.count -gt 0) { $interface.member.'interface-name' -join ', ' } else { "" }
269+
$interface.mtu = if ($interface.'mtu-override' -eq 'disable') { '' } else { $interface.mtu }
270+
$interface.mode = if ($interface.mode -eq 'static') { '' } else { $interface.mode }
271+
$interface.ip = if ($interface.ip -eq '0.0.0.0 0.0.0.0') { '' } else { if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $interface.ip } else { $interface.ip } }
272+
$interface.'secondaryip' = if ($interface.'secondary-ip' -eq 'enable' -and $null -ne $interface.'secondaryip') { ($interface.'secondaryip' | ForEach-Object { if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $_.ip } else { $_.ip } }) -join ', ' } else { "" }
273+
$interface.mode = if ($interface.mode -eq 'static') { '' } else { $interface.mode }
274+
$interface.vdom = if ($interface.vdom -eq 'root') { '' } else { $interface.vdom }
275+
$interface.vlanid = if ($interface.vlanid -gt 0) { $interface.vlanid } else { "" }
276+
$interface.speed = if ($interface.speed -eq 'auto') { '' } else { $interface.speed }
277+
$interface.'remote-ip' = if ($interface.'remote-ip' -eq '0.0.0.0 0.0.0.0') { '' } else { if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $interface.'remote-ip' } else { $interface.'remote-ip' } }
285278

286279
switch ($interfaceType) {
287280
"Aggregate" {

0 commit comments

Comments
 (0)