Hi, I am building a PAM request tool for the other team - it will add them temporarily to AD group being local admin on all servers they own/manage. Having created session configuration/role capability files allowing them only to execute Add-ADGroupMember cmdlet I registered session configuration and all tests were successful with this line in .psrc file.
VisibleCmdlets = 'Add-ADGroupMember'
However when I want to restrict this cmdlet to be executed only against AD group mentioned above, Add-ADGroupMember cmdlet is not longer recognized (as if it is not listed in .psrc file).
VisibleCmdlets = @{ Name = 'Add-ADGroupMember'; Parameters = @{ Name = 'Identity'; ValidateSet = 'DSC_Cloud_Admins' }}
I do not see any syntax mistake here and according to https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/jea/role-capabilities?view=powershell-5.1 this should work.
Why is this happening? Thank you in advance.