Skip to content

Commit fd9faef

Browse files
author
Gizachew Eshetie
committed
Generated help for new cmdlet and updated for the existing ones
1 parent 5e3ff69 commit fd9faef

File tree

5 files changed

+258
-69
lines changed

5 files changed

+258
-69
lines changed

src/Network/Network/AzureFirewallPolicy/NewAzureFirewallPolicyCommand.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ public override void Execute()
171171

172172
private PSAzureFirewallPolicy CreateAzureFirewallPolicy()
173173
{
174+
if (this.Snat != null && this.PrivateRange != null && this.PrivateRange.Length > 0)
175+
{
176+
throw new ArgumentException("Please use Snat parameter to set PrivateRange. Private ranges can not be provided on both Snat and PrivateRange parameters at the same time.");
177+
}
174178

175179
var firewallPolicy = new PSAzureFirewallPolicy()
176180
{

src/Network/Network/AzureFirewallPolicy/SetAzureFirewallPolicyCommand.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,11 @@ public override void Execute()
286286
}
287287
else
288288
{
289+
if (this.Snat != null && this.PrivateRange != null && this.PrivateRange.Length > 0)
290+
{
291+
throw new ArgumentException("Please use Snat parameter to set PrivateRange. Private ranges can not be provided on both Snat and PrivateRange parameters at the same time.");
292+
}
293+
289294
var firewallPolicy = new PSAzureFirewallPolicy()
290295
{
291296
Name = this.Name,

src/Network/Network/help/New-AzFirewallPolicy.md

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ New-AzFirewallPolicy -Name <String> -ResourceGroupName <String> -Location <Strin
1919
[-Tag <Hashtable>] [-Force] [-AsJob] [-IntrusionDetection <PSAzureFirewallPolicyIntrusionDetection>]
2020
[-TransportSecurityName <String>] [-TransportSecurityKeyVaultSecretId <String>] [-SkuTier <String>]
2121
[-UserAssignedIdentityId <String>] [-Identity <PSManagedServiceIdentity>] [-PrivateRange <String[]>]
22-
[-ExplicitProxy <PSAzureFirewallPolicyExplicitProxy>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
23-
[-Confirm] [<CommonParameters>]
22+
[-ExplicitProxy <PSAzureFirewallPolicyExplicitProxy>] [-Snat <PSAzureFirewallPolicySNAT>]
23+
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2424
```
2525

2626
## DESCRIPTION
@@ -73,8 +73,9 @@ This example creates a Firewall that treats "99.99.99.0/24" and "66.66.0.0/16" a
7373
$exProxy = New-AzFirewallPolicyExplicitProxy -EnableExplicitProxy -HttpPort 100 -HttpsPort 101 -EnablePacFile -PacFilePort 130 -PacFile "sampleurlfortesting.blob.core.windowsnet/nothing"
7474
New-AzFirewallPolicy -Name fp1 -ResourceGroupName TestRg -ExplicitProxy $exProxy
7575
```
76+
7677
```output
77-
BasePolicy : null
78+
BasePolicy : null
7879
DnsSettings : null
7980
Etag : null
8081
ExplicitProxy
@@ -106,8 +107,9 @@ New-AzFirewallPolicy -Name fp1 -ResourceGroupName TestRg -ExplicitProxy $exProxy
106107
ThreatIntelMode : "Alert"
107108
ThreatIntelWhitelist : null
108109
TransportSecurity : null
109-
Type : null
110+
Type : null
110111
```
112+
111113
This example creates a firewall policy with explicit proxy settings
112114

113115
## PARAMETERS
@@ -142,6 +144,21 @@ Accept pipeline input: True (ByPropertyName)
142144
Accept wildcard characters: False
143145
```
144146
147+
### -Confirm
148+
Prompts you for confirmation before running the cmdlet.
149+
150+
```yaml
151+
Type: SwitchParameter
152+
Parameter Sets: (All)
153+
Aliases: cf
154+
155+
Required: False
156+
Position: Named
157+
Default value: None
158+
Accept pipeline input: False
159+
Accept wildcard characters: False
160+
```
161+
145162
### -DefaultProfile
146163
The credentials, account, tenant, and subscription used for communication with Azure.
147164
@@ -308,6 +325,21 @@ Accept pipeline input: False
308325
Accept wildcard characters: False
309326
```
310327
328+
### -Snat
329+
The private IP addresses/IP ranges to which traffic will not be SNAT in Firewall Policy.
330+
331+
```yaml
332+
Type: PSAzureFirewallPolicySNAT
333+
Parameter Sets: (All)
334+
Aliases:
335+
336+
Required: False
337+
Position: Named
338+
Default value: None
339+
Accept pipeline input: False
340+
Accept wildcard characters: False
341+
```
342+
311343
### -SqlSetting
312344
The SQL related setting
313345
@@ -414,21 +446,6 @@ Accept pipeline input: False
414446
Accept wildcard characters: False
415447
```
416448
417-
### -Confirm
418-
Prompts you for confirmation before running the cmdlet.
419-
420-
```yaml
421-
Type: System.Management.Automation.SwitchParameter
422-
Parameter Sets: (All)
423-
Aliases: cf
424-
425-
Required: False
426-
Position: Named
427-
Default value: None
428-
Accept pipeline input: False
429-
Accept wildcard characters: False
430-
```
431-
432449
### -WhatIf
433450
Shows what would happen if the cmdlet runs.
434451
The cmdlet is not run.
@@ -461,4 +478,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
461478
## NOTES
462479
463480
## RELATED LINKS
464-
[New-AzFirewallPolicyExplicitProxy](./New-AzFirewallPolicyExplicitProxy.md)
481+
482+
[New-AzFirewallPolicyExplicitProxy](./New-AzFirewallPolicyExplicitProxy.md)
483+
[New-AzFirewallPolicySnat](./New-AzFirewallPolicySnat.md)
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
external help file: Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml
3+
Module Name: Az.Network
4+
online version:
5+
schema: 2.0.0
6+
---
7+
8+
# New-AzFirewallPolicySnat
9+
10+
## SYNOPSIS
11+
Creates SNAT configuration of PrivateRange and AutoLearnPrivateRanges for the firewall policy
12+
13+
## SYNTAX
14+
15+
```
16+
New-AzFirewallPolicySnat [-PrivateRange <String[]>] [-AutoLearnPrivateRanges]
17+
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
18+
```
19+
20+
## DESCRIPTION
21+
The New-AzFirewallPolicySnat is used to configure Private Ranges and auto learn private ranges for a firewall policy.
22+
23+
## EXAMPLES
24+
25+
### Example 1
26+
```powershell
27+
New-AzFirewallPolicySnat -PrivateRange @("3.3.0.0/24", "98.0.0.0/8","10.227.16.0/20") -AutoLearnPrivateRanges
28+
```
29+
```output
30+
PrivateRange : ["3.3.0.0/24", "98.0.0.0/8","10.227.16.0/20"]
31+
AutoLearnPrivateRanges : Enabled
32+
```
33+
34+
This example configures private IP addresses/IP ranges to which traffic will not be SNATed and enables auto learn of private ip ranges in Firewall Policy.
35+
36+
### Example 2
37+
```powershell
38+
New-AzFirewallPolicySnat -PrivateRange @("3.3.0.0/24", "98.0.0.0/8","10.227.16.0/20")
39+
```
40+
```output
41+
PrivateRange : ["3.3.0.0/24", "98.0.0.0/8","10.227.16.0/20"]
42+
AutoLearnPrivateRanges : Disabled
43+
```
44+
45+
This example configures private IP addresses/IP ranges to which traffic will not be SNATed and disables auto learn of private ip ranges in Firewall Policy.
46+
47+
## PARAMETERS
48+
49+
### -AutoLearnPrivateRanges
50+
Enable/disable auto learn private ranges.
51+
By default it is disabled.
52+
53+
```yaml
54+
Type: SwitchParameter
55+
Parameter Sets: (All)
56+
Aliases:
57+
58+
Required: False
59+
Position: Named
60+
Default value: None
61+
Accept pipeline input: False
62+
Accept wildcard characters: False
63+
```
64+
65+
### -Confirm
66+
Prompts you for confirmation before running the cmdlet.
67+
68+
```yaml
69+
Type: SwitchParameter
70+
Parameter Sets: (All)
71+
Aliases: cf
72+
73+
Required: False
74+
Position: Named
75+
Default value: None
76+
Accept pipeline input: False
77+
Accept wildcard characters: False
78+
```
79+
80+
### -DefaultProfile
81+
The credentials, account, tenant, and subscription used for communication with Azure.
82+
83+
```yaml
84+
Type: IAzureContextContainer
85+
Parameter Sets: (All)
86+
Aliases: AzContext, AzureRmContext, AzureCredential
87+
88+
Required: False
89+
Position: Named
90+
Default value: None
91+
Accept pipeline input: False
92+
Accept wildcard characters: False
93+
```
94+
95+
### -PrivateRange
96+
The Private IP Range
97+
98+
```yaml
99+
Type: String[]
100+
Parameter Sets: (All)
101+
Aliases:
102+
103+
Required: False
104+
Position: Named
105+
Default value: None
106+
Accept pipeline input: False
107+
Accept wildcard characters: False
108+
```
109+
110+
### -WhatIf
111+
Shows what would happen if the cmdlet runs.
112+
The cmdlet is not run.
113+
114+
```yaml
115+
Type: SwitchParameter
116+
Parameter Sets: (All)
117+
Aliases: wi
118+
119+
Required: False
120+
Position: Named
121+
Default value: None
122+
Accept pipeline input: False
123+
Accept wildcard characters: False
124+
```
125+
126+
### CommonParameters
127+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
128+
129+
## INPUTS
130+
131+
### None
132+
133+
## OUTPUTS
134+
135+
### Microsoft.Azure.Commands.Network.Models.PSAzureFirewallPolicySNAT
136+
137+
## NOTES
138+
139+
## RELATED LINKS
140+
[New-AzFireWallPolicy](./New-AzFireWallPolicy.md)
141+
142+
[Set-AzFireWallPolicy](./Set-AzFireWallPolicy.md)

0 commit comments

Comments
 (0)