public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            var vpnClientRootCertificate = new PSVpnClientRootCertificate();
            vpnClientRootCertificate.Name = this.Name;
            vpnClientRootCertificate.PublicCertData = this.PublicCertData;

            WriteObject(vpnClientRootCertificate);
        }
        public override void Execute()
        {

            base.Execute();
            if (!this.IsVirtualNetworkGatewayPresent(ResourceGroupName, VirtualNetworkGatewayName))
            {
                throw new ArgumentException(Microsoft.Azure.Commands.Network.Properties.Resources.ResourceNotFound);
            }

            var vnetGateway = this.GetVirtualNetworkGateway(this.ResourceGroupName, this.VirtualNetworkGatewayName);

            if (vnetGateway.VpnClientConfiguration == null)
            {
                vnetGateway.VpnClientConfiguration = new PSVpnClientConfiguration();
            }

            if (vnetGateway.VpnClientConfiguration.VpnClientRootCertificates == null)
            {
                vnetGateway.VpnClientConfiguration.VpnClientRootCertificates = new List<PSVpnClientRootCertificate>();
            }
            else
            {
                // Make sure the same client Root certificate is not already added on Gateway
                PSVpnClientRootCertificate vpnClientRootCertificate = vnetGateway.VpnClientConfiguration.VpnClientRootCertificates.Find(cert => cert.Name.Equals(VpnClientRootCertificateName)
                    && cert.PublicCertData.Equals(PublicCertData));
                if (vpnClientRootCertificate != null)
                {
                    throw new ArgumentException("Same vpn client root client certificate:" + VpnClientRootCertificateName + " PublicCertData:" + PublicCertData +
                        " is already added on Gateway! No need to add again!");
                }
            }

            PSVpnClientRootCertificate newVpnClientRootCertToAdd = new PSVpnClientRootCertificate()
            {
                Name = VpnClientRootCertificateName,
                PublicCertData = PublicCertData
            };
            vnetGateway.VpnClientConfiguration.VpnClientRootCertificates.Add(newVpnClientRootCertToAdd);

            // Map to the sdk object
            var virtualnetGatewayModel = Mapper.Map<MNM.VirtualNetworkGateway>(vnetGateway);
            virtualnetGatewayModel.Tags = TagsConversionHelper.CreateTagDictionary(vnetGateway.Tag, validate: true);

            this.VirtualNetworkGatewayClient.CreateOrUpdate(ResourceGroupName, VirtualNetworkGatewayName, virtualnetGatewayModel);

            var getvirtualnetGateway = this.GetVirtualNetworkGateway(ResourceGroupName, VirtualNetworkGatewayName);

            WriteObject(getvirtualnetGateway.VpnClientConfiguration.VpnClientRootCertificates, true);
        }