Skip to content

Commit 6548ab1

Browse files
committed
vscode: align settings with Template/Core
1 parent fffdeee commit 6548ab1

10 files changed

+464
-481
lines changed

.vscode/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"powershell.codeFormatting.whitespaceAfterSeparator": true,
99
"powershell.codeFormatting.addWhitespaceAroundPipe": true,
1010
"powershell.codeFormatting.ignoreOneLineBlock": true,
11-
"powershell.codeFormatting.newLineAfterCloseBrace": true,
11+
"powershell.codeFormatting.newLineAfterCloseBrace": false,
1212
"powershell.codeFormatting.newLineAfterOpenBrace": true,
1313
"powershell.codeFormatting.openBraceOnSameLine": true,
14-
"powershell.codeFormatting.alignPropertyValuePairs": true,
14+
"powershell.codeFormatting.alignPropertyValuePairs": false,
1515
"powershell.codeFolding.enable": true,
1616
"powershell.scriptAnalysis.enable": true,
1717
"powershell.scriptAnalysis.settingsPath": ".github/workflows/PSScriptAnalyzerSettings.psd1",
@@ -21,5 +21,5 @@
2121
"editor.rulers": [
2222
115
2323
],
24-
"files.trimTrailingWhitespace": true
24+
"files.trimTrailingWhitespace": true,
2525
}

Src/Private/Get-AbrFgtFirewall.ps1

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ function Get-AbrFgtFirewall {
268268

269269
if ($f.addrs.count -eq 0) {
270270
$addr = "Unresolved"
271-
}
272-
else {
271+
} else {
273272
$addr = $f.addrs -join ", "
274273
}
275274
$OutObj += [pscustomobject]@{
@@ -456,17 +455,15 @@ function Get-AbrFgtFirewall {
456455
if ($rule.'internet-service' -eq "enable") {
457456

458457
$dst = $rule.'internet-service-name'.name -join ", "
459-
}
460-
else {
458+
} else {
461459
$dst = $rule.dstaddr.name -join ", "
462460
}
463461

464462
#Using ISDB for Source ?
465463
if ($rule.'internet-service-src ' -eq "enable") {
466464

467465
$src = $rule.'internet-service-src-name'.name -join ", "
468-
}
469-
else {
466+
} else {
470467
$src = $rule.srcaddr.name -join ", "
471468
}
472469

@@ -512,17 +509,15 @@ function Get-AbrFgtFirewall {
512509
#Using ISDB for Destination ?
513510
if ($rule.'internet-service' -eq "enable") {
514511
$dst = $rule.'internet-service-name'.name -join ", "
515-
}
516-
else {
512+
} else {
517513
$dst = $rule.dstaddr.name -join ", "
518514
}
519515

520516
#Using ISDB for Source ?
521517
if ($rule.'internet-service-src ' -eq "enable") {
522518

523519
$src = $rule.'internet-service-src-name'.name -join ", "
524-
}
525-
else {
520+
} else {
526521
$src = $rule.srcaddr.name -join ", "
527522
}
528523

@@ -571,17 +566,15 @@ function Get-AbrFgtFirewall {
571566
#Using ISDB for Destination ?
572567
if ($rule.'internet-service' -eq "enable") {
573568
$dst = $rule.'internet-service-name'.name -join ", "
574-
}
575-
else {
569+
} else {
576570
$dst = $rule.dstaddr.name -join ", "
577571
}
578572

579573
#Using ISDB for Source ?
580574
if ($rule.'internet-service-src ' -eq "enable") {
581575

582576
$src = $rule.'internet-service-src-name'.name -join ", "
583-
}
584-
else {
577+
} else {
585578
$src = $rule.srcaddr.name -join ", "
586579
}
587580

@@ -659,8 +652,7 @@ function Get-AbrFgtFirewall {
659652
if ($rule.'internet-service' -eq "enable") {
660653

661654
$dst = $rule.'internet-service-name'.name -join ", "
662-
}
663-
else {
655+
} else {
664656
$dst = $rule.dstaddr.name -join ", "
665657
}
666658

@@ -670,8 +662,7 @@ function Get-AbrFgtFirewall {
670662
if ($rule.'internet-service-src ' -eq "enable") {
671663

672664
$src = $rule.'internet-service-src-name'.name -join ", "
673-
}
674-
else {
665+
} else {
675666
$src = $rule.srcaddr.name -join ", "
676667
}
677668
$src += " (From $($rule.srcintf.name -join ', '))"

Src/Private/Get-AbrFgtFortiCare.ps1

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ function Get-AbrFgtForticare {
115115
$description = $FortiGuardservicesDescriptions[$property.Name]
116116
if ($null -ne $feature.expires) {
117117
$expires = (Get-Date '01/01/1970').AddSeconds($feature.expires) | Get-Date -Format "dd/MM/yyyy"
118-
}
119-
else {
118+
} else {
120119
$expires = $null
121120
}
122121
$type = $feature.type
@@ -177,8 +176,7 @@ function Get-AbrFgtForticare {
177176
foreach ($license in $licenseSummary) {
178177
if ($license.status -eq 'licensed') {
179178
$licenseStatus = 'Licensed'
180-
}
181-
else {
179+
} else {
182180
$licenseStatus = 'Unlicensed'
183181
}
184182
$OutObj += [pscustomobject]@{
@@ -240,8 +238,7 @@ function Get-AbrFgtForticare {
240238
$firmware = Get-FGTMonitorSystemFirmware
241239
try {
242240
$firmware_upgrade_paths = Get-FGTMonitorSystemFirmware -upgrade_paths
243-
}
244-
catch {
241+
} catch {
245242
$firmware_upgrade_paths = $null
246243
}
247244

@@ -265,8 +262,7 @@ function Get-AbrFgtForticare {
265262
"Update" = "No Update Available"
266263
"Upgrade Path" = "N/A"
267264
}
268-
}
269-
else {
265+
} else {
270266
<# Search only last firmware on the same Branch
271267
$BranchUpdate = $firmware.available | Where-Object { $_.major -eq $CurrentVersion.Major -and $_.minor -eq $CurrentVersion.Minor } | Select-Object version -First 1
272268
if ($CurrentVersion -lt $BranchUpdateVersion) {
@@ -308,8 +304,7 @@ function Get-AbrFgtForticare {
308304
}
309305
#}
310306
}
311-
}
312-
else {
307+
} else {
313308

314309
#No $firmware.available info (no FortiCare/FortiGuard ?)
315310
$tab_upgradePath = [pscustomobject]@{

Src/Private/Get-AbrFgtRoute.ps1

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ function Get-AbrFgtRoute {
3838
Paragraph "The following section provides a summary of route settings."
3939
BlankLine
4040
$OutObj = [pscustomobject]@{
41-
"Monitor Route" = @($MonitorRouterIPv4).count
42-
"Static Route" = @($Statics).count
41+
"Monitor Route" = @($MonitorRouterIPv4).count
42+
"Static Route" = @($Statics).count
4343
"Policy Based Route" = @($PolicyBasedRouting).count
4444
}
4545

4646
$TableParams = @{
47-
Name = "Summary"
48-
List = $true
47+
Name = "Summary"
48+
List = $true
4949
ColumnWidths = 50, 50
5050
}
5151

@@ -66,23 +66,22 @@ function Get-AbrFgtRoute {
6666
#when there is blackhole, interface is set to Null
6767
if ("Null" -eq $route.interface) {
6868
$interface = "Blackhole"
69-
}
70-
else {
69+
} else {
7170
$interface = $route.interface
7271
}
7372

7473
$OutObj += [pscustomobject]@{
75-
"Type" = $route.type
76-
"IP/Mask" = $(if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $route.ip_mask } else { $route.ip_mask })
77-
"Gateway" = $route.gateway
78-
"Interface" = $interface
74+
"Type" = $route.type
75+
"IP/Mask" = $(if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $route.ip_mask } else { $route.ip_mask })
76+
"Gateway" = $route.gateway
77+
"Interface" = $interface
7978
"Distance/Metric/Priority" = "$($route.distance) / $($route.metric) / $($route.priority)"
8079
}
8180
}
8281

8382
$TableParams = @{
84-
Name = "Route Monitor"
85-
List = $false
83+
Name = "Route Monitor"
84+
List = $false
8685
ColumnWidths = 15, 25, 20, 20, 20
8786
}
8887

@@ -123,17 +122,17 @@ function Get-AbrFgtRoute {
123122
}
124123

125124
$OutObj += [pscustomobject]@{
126-
"Status" = $static.status
127-
"Destination" = $dst
128-
"Gateway" = $static.gateway
129-
"Interface" = $interface
125+
"Status" = $static.status
126+
"Destination" = $dst
127+
"Gateway" = $static.gateway
128+
"Interface" = $interface
130129
"Distance/Weight/Priority" = "$($static.distance) / $($static.weight) / $($static.priority)"
131130
}
132131
}
133132

134133
$TableParams = @{
135-
Name = "Static Route"
136-
List = $false
134+
Name = "Static Route"
135+
List = $false
137136
ColumnWidths = 15, 25, 20, 20, 20
138137
}
139138

@@ -153,32 +152,30 @@ function Get-AbrFgtRoute {
153152

154153
if ($pbr.src) {
155154
$src = $(if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $pbr.src.subnet } else { $pbr.src.subnet })
156-
}
157-
else {
155+
} else {
158156
$src = $pbr.srcaddr.name
159157
}
160158
if ($pbr.dst) {
161159
$dst = $(if ($Options.UseCIDRNotation) { Convert-AbrFgtSubnetToCIDR -Input $pbr.dst.subnet } else { $pbr.dst.subnet })
162-
}
163-
else {
160+
} else {
164161
$dst = $pbr.dstaddr.name
165162
}
166163

167164
$OutObj += [pscustomobject]@{
168-
"Status" = $pbr.status
169-
"Protocol" = $pbr.protocol
170-
"From" = $pbr.'input-device'.name
171-
"To" = $pbr.'ouput-device'
172-
"Source" = $src
165+
"Status" = $pbr.status
166+
"Protocol" = $pbr.protocol
167+
"From" = $pbr.'input-device'.name
168+
"To" = $pbr.'ouput-device'
169+
"Source" = $src
173170
"Destination" = $dst
174-
"Gateway" = $pbr.gateway
175-
"Action" = $pbr.action
171+
"Gateway" = $pbr.gateway
172+
"Action" = $pbr.action
176173
}
177174
}
178175

179176
$TableParams = @{
180-
Name = "Policy Based Route"
181-
List = $false
177+
Name = "Policy Based Route"
178+
List = $false
182179
ColumnWidths = 10, 12, 13, 13, 13, 13, 13, 13
183180
}
184181

0 commit comments

Comments
 (0)