-
Notifications
You must be signed in to change notification settings - Fork 4k
VPN Client Protocols for Virtual Network Gateways #4251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,16 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd | |
[ValidateNotNullOrEmpty] | ||
public List<string> VpnClientAddressPool { get; set; } | ||
|
||
[Parameter( | ||
Mandatory = false, | ||
ValueFromPipelineByPropertyName = true, | ||
HelpMessage = "P2S VPN client tunneling protocol")] | ||
[ValidateSet( | ||
MNM.VpnClientProtocol.SSTP, | ||
MNM.VpnClientProtocol.IkeV2)] | ||
[ValidateNotNullOrEmpty] | ||
public List<string> VpnClientProtocols { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @henry416 this parameter should be renamed to Avoid using plural names for parameters whose value is a single element. This includes parameters that take arrays or lists because the user might supply an array or list with only one element. Plural parameter names should be used only in those cases where the value of the parameter is always a multiple-element value. In these cases, the cmdlet should verify that multiple elements are supplied, and the cmdlet should display a warning to the user if multiple elements are not supplied. |
||
|
||
[Parameter( | ||
Mandatory = false, | ||
ValueFromPipelineByPropertyName = true, | ||
|
@@ -281,6 +291,11 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway() | |
vnetGateway.VpnClientConfiguration.VpnClientAddressPool.AddressPrefixes = this.VpnClientAddressPool; | ||
} | ||
|
||
if (this.VpnClientProtocols != null) | ||
{ | ||
vnetGateway.VpnClientConfiguration.VpnClientProtocols = this.VpnClientProtocols; | ||
} | ||
|
||
if (this.VpnClientRootCertificates != null) | ||
{ | ||
vnetGateway.VpnClientConfiguration.VpnClientRootCertificates = this.VpnClientRootCertificates; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,16 @@ public class SetAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd | |
[ValidateNotNullOrEmpty] | ||
public List<string> VpnClientAddressPool { get; set; } | ||
|
||
[Parameter( | ||
Mandatory = false, | ||
ValueFromPipelineByPropertyName = true, | ||
HelpMessage = "P2S VPN client tunneling protocol")] | ||
[ValidateSet( | ||
MNM.VpnClientProtocol.SSTP, | ||
MNM.VpnClientProtocol.IkeV2)] | ||
[ValidateNotNullOrEmpty] | ||
public List<string> VpnClientProtocols { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @henry416 same comment |
||
|
||
[Parameter( | ||
Mandatory = false, | ||
ValueFromPipelineByPropertyName = true, | ||
|
@@ -158,6 +168,11 @@ public override void Execute() | |
this.VirtualNetworkGateway.VpnClientConfiguration.VpnClientAddressPool.AddressPrefixes = this.VpnClientAddressPool; | ||
} | ||
|
||
if (this.VpnClientProtocols != null) | ||
{ | ||
this.VirtualNetworkGateway.VpnClientConfiguration.VpnClientProtocols = this.VpnClientProtocols; | ||
} | ||
|
||
if (this.VpnClientRootCertificates != null) | ||
{ | ||
this.VirtualNetworkGateway.VpnClientConfiguration.VpnClientRootCertificates = this.VpnClientRootCertificates; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@henry416 this should be a check-in test