public override void ExecuteCmdlet()
        {
            if (InputObject != null)
            {
                Name = InputObject.Name;
                ResourceGroupName = InputObject.ResourceGroupName;
            }
            else if (ResourceId != null)
            {
                var resourceIdentifier = new ResourceIdentifier(ResourceId);
                Name = resourceIdentifier.ResourceName;
                ResourceGroupName = resourceIdentifier.ResourceGroupName;
            }

            // Get resource group name for Managed HSM
            ResourceGroupName = string.IsNullOrWhiteSpace(ResourceGroupName) ? GetResourceGroupName(Name, true) : ResourceGroupName;
            if (string.IsNullOrWhiteSpace(ResourceGroupName))
            {
                throw new ArgumentException(string.Format(Resources.HsmNotFound, Name, ResourceGroupName));
            }

            ConfirmAction(
                Force.IsPresent,
                string.Format(
                    CultureInfo.InvariantCulture,
                    Resources.RemoveHsmWarning,
                    Name),
                string.Format(
                    CultureInfo.InvariantCulture,
                    Resources.RemoveHsmWhatIfMessage,
                    Name),
                Name,
                () =>
            {
                KeyVaultManagementClient.DeleteManagedHsm(
                    managedHsm: Name,
                    resourceGroupName: ResourceGroupName);

                if (PassThru)
                {
                    WriteObject(true);
                }
            });
        }