public override void Execute()
{
base.Execute();
var vnetGateway = this.GetVirtualNetworkGateway(this.ResourceGroupName, this.VirtualNetworkGatewayName);
if (!string.IsNullOrEmpty(this.VpnClientRevokedCertificateName))
{
PSVpnClientRevokedCertificate clientRevokedCertificate = vnetGateway.VpnClientConfiguration.VpnClientRevokedCertificates.Find(cert => cert.Name.Equals(VpnClientRevokedCertificateName));
if (clientRevokedCertificate == null)
{
throw new ArgumentException(Microsoft.Azure.Commands.Network.Properties.Resources.ResourceNotFound);
}
else
{
WriteObject(clientRevokedCertificate);
}
}
else
{
WriteObject(vnetGateway.VpnClientConfiguration.VpnClientRevokedCertificates, true);
}
}
}