Skip to content

Commit b577dba

Browse files
committed
update disconnect vpn/p2svpn gateway vpn connections
1 parent 6c50d44 commit b577dba

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@ public class DisconnectAzureP2SVpnGatewayVpnConnectionCommand : P2SVpnGatewayBas
4949

5050
[Parameter(
5151
ParameterSetName = CortexParameterSetNames.ByP2SVpnGatewayResourceId,
52-
Mandatory = false,
52+
Mandatory = true,
5353
ValueFromPipelineByPropertyName = true,
5454
HelpMessage = "The Azure resource ID of the P2SVpnGateway to be modified.")]
5555
[ValidateNotNullOrEmpty]
56+
[ResourceIdCompleter("Microsoft.Network/p2sVpnGateways")]
5657
public string ResourceId { get; set; }
5758

5859
[Alias("P2SVpnGateway")]
5960
[Parameter(
6061
ParameterSetName = CortexParameterSetNames.ByP2SVpnGatewayObject,
61-
Mandatory = false,
62+
Mandatory = true,
6263
ValueFromPipeline = true,
6364
HelpMessage = "The P2S vpn gateway object")]
6465
[ValidateNotNullOrEmpty]
@@ -69,6 +70,14 @@ public class DisconnectAzureP2SVpnGatewayVpnConnectionCommand : P2SVpnGatewayBas
6970
HelpMessage = "P2S Vpn gateway gateway Vpn connection Id, which is returned by getting P2S Vpn gateway detailed connection health")]
7071
[ValidateNotNullOrEmpty]
7172
public string[] VpnConnectionId { get; set; }
73+
74+
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
75+
public SwitchParameter AsJob { get; set; }
76+
77+
[Parameter(
78+
Mandatory = false,
79+
HelpMessage = "Returns an object representing the item on which this operation is being performed.")]
80+
public SwitchParameter PassThru { get; set; }
7281

7382
public override void Execute()
7483
{

src/Network/Network/VirtualNetworkGateway/DisconnectAzureVirtualNetworkGatewayVpnConnection.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ public class DisconnectVirtualNetworkGatewayVpnConnectionCommand : VirtualNetwor
2424

2525
[Alias("VirtualNetworkGatewayId")]
2626
[Parameter(
27-
Mandatory = false,
27+
Mandatory = true,
2828
ValueFromPipelineByPropertyName = true,
2929
ParameterSetName = ParameterSetNames.ByResourceId,
3030
HelpMessage = "The resource id of the virtual network gateway Id")]
31+
[ResourceIdCompleter("Microsoft.Network/virtualNetworkGateways")]
32+
[ValidateNotNullOrEmpty]
3133
public string ResourceId { get; set; }
3234

3335
[Alias("VirtualNetworkGateway")]
@@ -36,6 +38,7 @@ public class DisconnectVirtualNetworkGatewayVpnConnectionCommand : VirtualNetwor
3638
ValueFromPipeline = true,
3739
ParameterSetName = ParameterSetNames.ByFactoryObject,
3840
HelpMessage = "The virtual network gateway object")]
41+
[ValidateNotNullOrEmpty]
3942
public PSVirtualNetworkGateway InputObject { get; set; }
4043

4144
[Parameter(
@@ -56,6 +59,11 @@ public class DisconnectVirtualNetworkGatewayVpnConnectionCommand : VirtualNetwor
5659
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
5760
public SwitchParameter AsJob { get; set; }
5861

62+
[Parameter(
63+
Mandatory = false,
64+
HelpMessage = "Returns an object representing the item on which this operation is being performed.")]
65+
public SwitchParameter PassThru { get; set; }
66+
5967
public override void Execute()
6068
{
6169
if (ParameterSetName.Equals(ParameterSetNames.ByFactoryObject, StringComparison.OrdinalIgnoreCase))

src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,21 @@ Accept pipeline input: False
127127
Accept wildcard characters: False
128128
```
129129
130+
### -ResourceId
131+
P2s Virtual network gateway resource Id
132+
133+
```yaml
134+
Type: System.String
135+
Parameter Sets: (All)
136+
Aliases: ResourceId
137+
138+
Required: False
139+
Position: Named
140+
Default value: None
141+
Accept pipeline input: True (ByPropertyName)
142+
Accept wildcard characters: False
143+
```
144+
130145
### CommonParameters
131146
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).
132147

0 commit comments

Comments
 (0)