From 305d56a4bcb4c92969afe78702a10efe327dcf9b Mon Sep 17 00:00:00 2001 From: Ning Wei Date: Wed, 12 Feb 2020 13:51:01 -0800 Subject: [PATCH 1/3] update disconnect vpn/p2svpn gateway vpn connections --- .../DisconnectAzureP2SVpnGatewayVpnConnection.cs | 13 +++++++++++-- ...nectAzureVirtualNetworkGatewayVpnConnection.cs | 10 +++++++++- .../Disconnect-AzP2sVpnGatewayVpnConnection.md | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs b/src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs index b2a12b59c798..d14941cba5c3 100644 --- a/src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs +++ b/src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs @@ -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] @@ -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() { diff --git a/src/Network/Network/VirtualNetworkGateway/DisconnectAzureVirtualNetworkGatewayVpnConnection.cs b/src/Network/Network/VirtualNetworkGateway/DisconnectAzureVirtualNetworkGatewayVpnConnection.cs index fb15869f0e6d..70851aedbe36 100644 --- a/src/Network/Network/VirtualNetworkGateway/DisconnectAzureVirtualNetworkGatewayVpnConnection.cs +++ b/src/Network/Network/VirtualNetworkGateway/DisconnectAzureVirtualNetworkGatewayVpnConnection.cs @@ -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")] @@ -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( @@ -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)) diff --git a/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md b/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md index e5ba3674cc1d..ade1e8fd796f 100644 --- a/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md +++ b/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md @@ -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: (All) +Aliases: ResourceId + +Required: False +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). From 6ac5e93142ed697b5d81dfa6a3a551b8dff66289 Mon Sep 17 00:00:00 2001 From: Ning Wei Date: Wed, 12 Feb 2020 14:04:34 -0800 Subject: [PATCH 2/3] update disconnect vpn/p2svpn gateway vpn connections --- ...Disconnect-AzP2sVpnGatewayVpnConnection.md | 6 ++--- ...ct-AzVirtualNetworkGatewayVpnConnection.md | 22 ++++++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md b/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md index ade1e8fd796f..08447b3f008b 100644 --- a/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md +++ b/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md @@ -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 @@ -132,10 +132,10 @@ P2s Virtual network gateway resource Id ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: ByP2SVpnGatewayResourceId Aliases: ResourceId -Required: False +Required: True Position: Named Default value: None Accept pipeline input: True (ByPropertyName) diff --git a/src/Network/Network/help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md b/src/Network/Network/help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md index 5d9aa06128c3..c776e54d9eaa 100644 --- a/src/Network/Network/help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md +++ b/src/Network/Network/help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md @@ -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 -ResourceGroupName -InputObject -ResourceId -VpnConnectionId [-AsJob] [] ``` +### ByVpnGatewayObject +``` +Disconnect-AzVirtualNetworkGatewayVpnConnection -InputObject -VpnConnectionId [] +``` + +### ByVpnGatewayResourceId +``` +Disconnect-AzVirtualNetworkGatewayVpnConnection -ResourceId -VpnConnectionId [] +``` + ## DESCRIPTION The **Disconnect-AzVirtualNetworkGatewayVpnConnection** cmdlet enables you to disconnect given connected vpn client connection. @@ -34,7 +44,7 @@ Virtual network gateway resource group's name ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: ByVpnGatewayName Aliases: Required: True @@ -49,7 +59,7 @@ Virtual network gateway name ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: ByVpnGatewayName Aliases: VirtualNetworkGatewayName Required: True @@ -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) @@ -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 From 2c7eb176adcf0151982cab530a35b1e0fb62001f Mon Sep 17 00:00:00 2001 From: Ning Wei Date: Thu, 13 Feb 2020 13:50:44 -0800 Subject: [PATCH 3/3] fix help file --- .../Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md | 2 +- .../help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md b/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md index 08447b3f008b..06113a7be5af 100644 --- a/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md +++ b/src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md @@ -151,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 diff --git a/src/Network/Network/help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md b/src/Network/Network/help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md index c776e54d9eaa..6d208bcc5e14 100644 --- a/src/Network/Network/help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md +++ b/src/Network/Network/help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md @@ -138,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