-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.
Description
Description
Remove-AzRoleDefinition displays incorrect confirmation message and target when using -WhatIf or -Confirm:
- The action description shows an unformatted placeholder
'{0}'instead of the actual value - When using
-Nameparameter, the target shows empty GUID00000000-0000-0000-0000-000000000000instead of the role name
Expected behavior:
-Idshould show:Performing the operation "Removing role definition by id" on target "<guid>"-Nameshould show:Performing the operation "Removing role definition by name" on target "<name>"
Actual behavior:
- Both show:
Performing the operation "Are you sure you want to remove role definition with id '{0}'." on target "<guid-or-empty-guid>"
Bug Summary Table
| Command | Buggy Output |
|---|---|
Remove-AzRoleDefinition -Id $(New-Guid) -Confirm |
Performing the operation "Are you sure you want to remove role definition with id '{0}'." on target "4090e780-c302-45f9-ad9b-6b53f4832e7e" |
Remove-AzRoleDefinition -Name abc -Confirm |
Performing the operation "Are you sure you want to remove role definition with id '{0}'." on target "00000000-0000-0000-0000-000000000000" |
Remove-AzRoleDefinition -Id $(New-Guid) -WhatIf |
Performing the operation "Are you sure you want to remove role definition with id '{0}'." on target "5c889b20-ba53-4bd5-bae7-f36ff3259502" |
Remove-AzRoleDefinition -Name abc -WhatIf |
Performing the operation "Are you sure you want to remove role definition with id '{0}'." on target "00000000-0000-0000-0000-000000000000" |
Issue script & Debug output
PS> $DebugPreference='Continue'
# Bug with -Name parameter (shows empty GUID)
PS> Remove-AzRoleDefinition -Name abc -WhatIf
What if: Performing the operation "Are you sure you want to remove role definition with id '{0}'." on target "00000000-0000-0000-0000-000000000000".
# Bug with -Id parameter (shows unformatted placeholder)
PS> Remove-AzRoleDefinition -Id $(New-Guid) -WhatIf
What if: Performing the operation "Are you sure you want to remove role definition with id '{0}'." on target "3248f3b0-b7c7-4114-b0f9-c04873e3d5df".Environment data
PS> $PSVersionTable
Name Value
---- -----
PSVersion 7.5.3
PSEdition Core
GitCommitId 7.5.3
OS Darwin 24.6.0 Darwin Kernel Version 24.6.0
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Module versions
PS> Get-Module Az*
Name Version
---- -------
Az.Accounts 5.3.2
Az.Resources 9.0.0Error output
N/A - This is a display issue, not an error.Metadata
Metadata
Assignees
Labels
bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.