Beispiel #1
0
        public override void ExecuteCmdlet()
        {
            switch (ParameterSetName)
            {
            case GetManagedHsmParameterSet:
                ResourceGroupName = string.IsNullOrWhiteSpace(ResourceGroupName) ? GetResourceGroupName(Name, true) : ResourceGroupName;

                if (ShouldGetByName(ResourceGroupName, Name))
                {
                    WriteObject(FilterByTag(KeyVaultManagementClient.GetManagedHsm(
                                                Name,
                                                ResourceGroupName,
                                                GraphClient), Tag));
                }
                else
                {
                    WriteObject(
                        TopLevelWildcardFilter(
                            ResourceGroupName, Name,
                            FilterByTag(
                                KeyVaultManagementClient.ListManagedHsms(ResourceGroupName, GraphClient), Tag)),
                        true);
                }
                break;

            case GetDeletedManagedHsmParameterSet:
                WriteObject(FilterByTag(KeyVaultManagementClient.GetDeletedManagedHsm(
                                            Name,
                                            Location), Tag));
                break;

            case ListDeletedManagedHsmsParameterSet:
                WriteObject(FilterByTag(
                                KeyVaultManagementClient.ListDeletedManagedHsms(),
                                Tag), true);
                break;

            default:
                throw new ArgumentException(Resources.BadParameterSetName);
            }
        }