Skip to content

Description of -Name parameter of Get-AzPolicySetDefinition cmdlet  #21679

Open

Description

Description

Here, the description of -Name parameter of Get-AzPolicySetDefinition cmdlet says "The policy set definition name." as shown in below screenshot.

image

But in reality it shows ID of the policy set definition id but not the name of the policy set definition as shown in below screenshots.

image

image

This confirms that either change the parameter name from "Name" to be more appropriate and/or update the description of the Name parameter to avoid confusion for customers.

Issue script & Debug output

[Here](https://learn.microsoft.com/en-us/powershell/module/az.resources/get-azpolicysetdefinition?view=azps-9.7.0&viewFallbackFrom=azps-9.4.0), the description of -Name parameter of Get-AzPolicySetDefinition cmdlet says "The policy set definition name." as shown in below screenshot.

<img width="391" alt="image" src="https://user-images.githubusercontent.com/45988031/235474355-3bcc3664-4729-4103-930d-44afe7941627.png">

But in reality it shows ID of the policy set definition id but not the name of the policy set definition as shown in below screenshots.

<img width="780" alt="image" src="https://user-images.githubusercontent.com/45988031/235474586-8aaebea8-e95d-4cd3-b2fa-2d02f1bbad76.png">

<img width="579" alt="image" src="https://user-images.githubusercontent.com/45988031/235474675-6bf1c022-b525-4ce5-a2a4-3baf085aa48f.png">

This confirms that either change the parameter name from "Name" to be more appropriate and/or update the description of the Name parameter to avoid confusion for customers.

Environment data

PS /home/t> $PSVersionTable                                             

Name                           Value
----                           -----
PSVersion                      7.3.4
PSEdition                      Core
GitCommitId                    7.3.4
OS                             Linux 5.4.0-1107-azure #113~18.04.1-Ubuntu SMP Tue Apr 25 13:58:29 UTC 2023
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

PS /home/t> Get-Module Az*

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.12.2                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     5.7.1                 Az.Compute                          {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent, Add-AzVMDataDisk…}
Script     5.7.0                 Az.Network                          {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzA…
Script     6.6.1                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script     5.6.0                 Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNet…
Script     1.1.1                 Az.Tools.Predictor                  {Disable-AzPredictor, Enable-AzPredictor, Open-AzPredictorSurvey, Send-AzPredictorRating}
Script     0.0.0.10              AzureAD.Standard.Preview            {Add-AzureADApplicationOwner, Add-AzureADDeviceRegisteredOwner, Add-AzureADDeviceRegisteredUser, Add-Az…
Script     0.9.3                 AzurePSDrive                        

PS /home/t>

Error output

PS /home/t> Resolve-AzError                                                                    
WARNING: Upcoming breaking changes in the cmdlet 'Resolve-AzError' :
The `Resolve-Error` alias will be removed in a future release.  Please change any scripts that use this alias to use `Resolve-AzError` instead.
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.

   HistoryId: 35

Message        : The term 'resolve' is not recognized as a name of a cmdlet, function, script file, or executable program.
                 Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
StackTrace     :    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions 
                 searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)
                    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin commandOrigin, ExecutionContext context)
                    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin commandOrigin)
                    at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)
                    at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)
                    at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst 
                 commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)
                    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, 
                 CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
                    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
                    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Exception      : System.Management.Automation.CommandNotFoundException
InvocationInfo : {}
Line           : resolve
Position       : At line:1 char:1
                 + resolve
                 + ~~~~~~~
HistoryId      : 35


   HistoryId: 3

Message        : PolicySetDefinitionNotFound : The policy set definition 'NIST SP 800-171 Rev. 2' could not be found.
                 CorrelationId: 8fe83417-c12b-433b-8734-6fe73fc37806
StackTrace     :    at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.HandleException(ExceptionDispatchInfo capturedException)
                    at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.ErrorResponses.ErrorResponseMessageException
InvocationInfo : {Get-AzPolicySetDefinition}
Line           : Get-AzPolicySetDefinition -Name "NIST SP 800-171 Rev. 2"
Position       : At line:1 char:1
                 + Get-AzPolicySetDefinition -Name "NIST SP 800-171 Rev. 2"
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    PolicyAzure Resource PolicyService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions