Created
September 20, 2019 22:59
-
-
Save frankhu-2021/dec59b48058350e0d448905f5d9f7594 to your computer and use it in GitHub Desktop.
This PowerShell script will list all the definitions from the Azure RBAC role that you put in the -name parameter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzRoleDefinition -name "<Insert-Your-Azure-RBAC-Role>" | ` | |
%{ | |
$a = $_ | |
$_.Actions | select ` | |
@{n="Role";e={$a.Name}}, | |
@{n="Type";e={"Actions"}}, | |
@{n="Definition";e={$_}} | |
$_.DataActions | select ` | |
@{n="Role";e={$a.Name}}, | |
@{n="Type";e={"DataActions"}}, | |
@{n="Definition";e={$_}} | |
$_.NotActions | select ` | |
@{n="Role";e={$a.Name}}, | |
@{n="Type";e={"NotActions"}}, | |
@{n="Definition";e={$_}} | |
$_.NotDataActions | select ` | |
@{n="Role";e={$a.Name}}, | |
@{n="Type";e={"NotDataActions"}}, | |
@{n="Definition";e={$_}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment