Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ public class DisconnectAzureP2SVpnGatewayVpnConnectionCommand : P2SVpnGatewayBas

[Parameter(
ParameterSetName = CortexParameterSetNames.ByP2SVpnGatewayResourceId,
Mandatory = false,
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Azure resource ID of the P2SVpnGateway to be modified.")]
[ValidateNotNullOrEmpty]
[ResourceIdCompleter("Microsoft.Network/p2sVpnGateways")]
public string ResourceId { get; set; }

[Alias("P2SVpnGateway")]
[Parameter(
ParameterSetName = CortexParameterSetNames.ByP2SVpnGatewayObject,
Mandatory = false,
Mandatory = true,
ValueFromPipeline = true,
HelpMessage = "The P2S vpn gateway object")]
[ValidateNotNullOrEmpty]
Expand All @@ -69,6 +70,14 @@ public class DisconnectAzureP2SVpnGatewayVpnConnectionCommand : P2SVpnGatewayBas
HelpMessage = "P2S Vpn gateway gateway Vpn connection Id, which is returned by getting P2S Vpn gateway detailed connection health")]
[ValidateNotNullOrEmpty]
public string[] VpnConnectionId { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
public SwitchParameter AsJob { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Returns an object representing the item on which this operation is being performed.")]
public SwitchParameter PassThru { get; set; }

public override void Execute()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ public class DisconnectVirtualNetworkGatewayVpnConnectionCommand : VirtualNetwor

[Alias("VirtualNetworkGatewayId")]
[Parameter(
Mandatory = false,
Mandatory = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = ParameterSetNames.ByResourceId,
HelpMessage = "The resource id of the virtual network gateway Id")]
[ResourceIdCompleter("Microsoft.Network/virtualNetworkGateways")]
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }

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

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

[Parameter(
Mandatory = false,
HelpMessage = "Returns an object representing the item on which this operation is being performed.")]
public SwitchParameter PassThru { get; set; }

public override void Execute()
{
if (ParameterSetName.Equals(ParameterSetNames.ByFactoryObject, StringComparison.OrdinalIgnoreCase))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ P2SConnectionConfigurations : [
The p2s vpn gateway object to be modified

```yaml
Type: PSP2SVpnGateway
Type: Microsoft.Azure.Commands.Network.Models.PSP2SVpnGateway
Parameter Sets: ByP2SVpnGatewayObject
Aliases: P2SVpnGateway

Expand Down Expand Up @@ -127,6 +127,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ResourceId
P2s Virtual network gateway resource Id

```yaml
Type: System.String
Parameter Sets: ByP2SVpnGatewayResourceId
Aliases: ResourceId

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### CommonParameters
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).

Expand All @@ -136,7 +151,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.Commands.Network.Models.PSP2SVpnConnectionHealth
### Microsoft.Azure.Commands.Network.Models.PSP2SVpnGateway

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@ schema: 2.0.0
Disconnect given connected vpn client connections with a given virtual network gateway.

## SYNTAX

### ByVpnGatewayName (Default)
```
Disconnect-AzVirtualNetworkGatewayVpnConnection -ResourceName <String> -ResourceGroupName <String> -InputObject <PSVirtualNetworkGateway> -ResourceId <ResourceId> -VpnConnectionId <VpnConnectionIds> [-AsJob] [<CommonParameters>]
```

### ByVpnGatewayObject
```
Disconnect-AzVirtualNetworkGatewayVpnConnection -InputObject <PSP2SVpnGateway> -VpnConnectionId <VpnConnectionId> [<CommonParameters>]
```

### ByVpnGatewayResourceId
```
Disconnect-AzVirtualNetworkGatewayVpnConnection -ResourceId <String> -VpnConnectionId <VpnConnectionId> [<CommonParameters>]
```

## DESCRIPTION
The **Disconnect-AzVirtualNetworkGatewayVpnConnection** cmdlet enables you to disconnect given connected vpn client connection.

Expand All @@ -34,7 +44,7 @@ Virtual network gateway resource group's name

```yaml
Type: System.String
Parameter Sets: (All)
Parameter Sets: ByVpnGatewayName
Aliases:

Required: True
Expand All @@ -49,7 +59,7 @@ Virtual network gateway name

```yaml
Type: System.String
Parameter Sets: (All)
Parameter Sets: ByVpnGatewayName
Aliases: VirtualNetworkGatewayName

Required: True
Expand All @@ -64,10 +74,10 @@ Virtual network gateway resource Id

```yaml
Type: System.String
Parameter Sets: (All)
Parameter Sets: ByVpnGatewayResourceId
Aliases: ResourceId

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Expand All @@ -94,7 +104,7 @@ Virtual network gateway object

```yaml
Type: Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway
Parameter Sets: (All)
Parameter Sets: ByVpnGatewayObject
Aliases: VirtualNetworkGateway

Required: False
Expand Down Expand Up @@ -128,7 +138,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.Commands.Network.Models.PSGatewayRoute
### Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway

## NOTES

Expand Down