powershell
powershell copied to clipboard
RoleDefinitionPipeBind: specifying RoleDefinition by Id
Type
- [x] New Feature
Allow specifying RoleDefinition by Id anywhere where RoleDefinitionPipeBind is used. The (presumably rare) case where the name of role definition could parse as an integer continues to work.
Example:
## Get a role definition by ID
Get-PnPRoleDefinition 1073741829
## Rename a role definition by ID
Set-PnPRoleDefinition -Identity 1073741926 -NewRoleName "100"
## Get a role definition by name
$roleDef = Get-PnPRoleDefinition "100"
## Rename a role definition by object
Set-PnPRoleDefinition $roleDef -NewRoleName "My Custom Permission Level"