-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SA-3040: Add/Remove-JCCloudDirectory Member Functions #554
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I think this is really good, I think we do need to make a change in the data that we are gathering in each function. I'm okay to debate it and come up with a team solution if you feel one way or another but I'd argue we shouldn't be building hash objects for users and usergroups.
PowerShell/JumpCloud Module/Public/Directory/Add-JCGsuiteMember.ps1
Outdated
Show resolved
Hide resolved
PowerShell/JumpCloud Module/Public/Directory/Add-JCGsuiteMember.ps1
Outdated
Show resolved
Hide resolved
PowerShell/JumpCloud Module/Public/Directory/Remove-JCOffice365Member.ps1
Outdated
Show resolved
Hide resolved
PowerShell/JumpCloud Module/Tests/Public/Directory/Add-JCGsuiteMember.Tests.ps1
Show resolved
Hide resolved
PowerShell/JumpCloud Module/Tests/Public/Directory/Add-JCOffice365Member.Tests.ps1
Show resolved
Hide resolved
PowerShell/JumpCloud Module/Tests/Public/Directory/Remove-JCGsuiteMember.Tests.ps1
Show resolved
Hide resolved
PowerShell/JumpCloud Module/Tests/Public/Directory/Remove-JCOffice365Member.Tests.ps1
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work overall, like Joe stated on his comments, Get-DynamicHash is inefficient for small pulls but something like Search should do.
PowerShell/JumpCloud Module/Public/Directory/Add-JCGsuiteMember.ps1
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the changes, just one last function (Remove-JCGsuiteMember
) needs that re-work for user/ group hash but otherwise this looks correct. Thanks for the revision
PowerShell/JumpCloud Module/Public/Directory/Remove-JCGsuiteMember.ps1
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work. Tests are good on my end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! Everything looks great!
Issues
What does this solve?
This introduces the following functions:
Currently, admins need to utilize the Add/Remove-JCAssociation functions to adjust their memberships to these groups. With the introduction of the Get/Set-JCCloudDirectory functions, it would make it easier on the admins to programatically adjust their CloudDirectory memberships via easy and intuitive functions.
Is there anything particularly tricky?
N/A
How should this be tested?
Pester test suites have been created for each of the functions. However we should test to ensure that correct information is being passed into the function, example:
Add-JCOffice365Member -ID <Office365InstanceID> -Username John.Doe -UserID <userID>
| This should throw, only one property should be passed per call (either username OR userid, not both)Add-JCOffice365Member -ID <Office365InstanceID> -GroupName Office365Users -GroupID <groupID>
| This should throw, only one property should be passed per call (either groupName OR groupID, not both)Add-JCOffice365Member -ID <Office365InstanceID> -Username John.Doe -GroupName 'Office365Users'
| This should throw. Cannot specify both user and usergroup at the same timeThese 3 exceptions should be present for all 4 functions