Roles are retrieved based on the user object piped in - if the user object is saved in a variable then any new roles since the user was retrieved will not be included.
Step 2
Mappings are reapplied and a new role is added.
Step 3
$User | Get-OneLoginUserRole
The new role is not returned. This is because the roles are retrieved based on the role ids included in the user object which has been saved statically in the $user variable. Get-OneLoginUserRole should re-retrieve these role ids before returning the role objects.
Roles are retrieved based on the user object piped in - if the user object is saved in a variable then any new roles since the user was retrieved will not be included.
Repro:
Step 1
Step 2 Mappings are reapplied and a new role is added.
Step 3
The new role is not returned. This is because the roles are retrieved based on the role ids included in the user object which has been saved statically in the $user variable. Get-OneLoginUserRole should re-retrieve these role ids before returning the role objects.