Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Commit 437611c

Browse files
Merge pull request #1573 from vipulkelkar/GetGroupClassification
Get group classification from the Get-PnPUnifiedGroup command
2 parents df5ceab + 9a0e951 commit 437611c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Commands/Base/PipeBinds/UnifiedGroupPipeBind.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ public UnifiedGroupPipeBind(String input)
4242

4343
public String GroupId => (_groupId);
4444

45-
public UnifiedGroupEntity GetGroup(string accessToken)
45+
public UnifiedGroupEntity GetGroup(string accessToken, bool includeClassification = false)
4646
{
4747
UnifiedGroupEntity group = null;
4848
if (Group != null)
4949
{
50-
group = UnifiedGroupsUtility.GetUnifiedGroup(Group.GroupId, accessToken);
50+
group = UnifiedGroupsUtility.GetUnifiedGroup(Group.GroupId, accessToken, includeClassification:includeClassification);
5151
}
5252
else if (!String.IsNullOrEmpty(GroupId))
5353
{
54-
group = UnifiedGroupsUtility.GetUnifiedGroup(GroupId, accessToken);
54+
group = UnifiedGroupsUtility.GetUnifiedGroup(GroupId, accessToken, includeClassification:includeClassification);
5555
}
5656
else if (!string.IsNullOrEmpty(DisplayName))
5757
{
58-
var groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, DisplayName, includeSite: true);
58+
var groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, DisplayName, includeSite: true, includeClassification:includeClassification);
5959
if (groups == null || groups.Count == 0)
6060
{
61-
groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, mailNickname: DisplayName, includeSite: true);
61+
groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, mailNickname: DisplayName, includeSite: true, includeClassification:includeClassification);
6262
}
6363
if (groups != null && groups.Any())
6464
{

Commands/Graph/GetUnifiedGroup.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public class GetUnifiedGroup : PnPGraphCmdlet
4646
[Parameter(Mandatory = false, HelpMessage = "Exclude fetching the site URL for Office 365 Groups. This speeds up large listings.")]
4747
public SwitchParameter ExcludeSiteUrl;
4848

49+
[Parameter(Mandatory = false, HelpMessage = "Include Classification value of Office 365 Groups.")]
50+
public SwitchParameter IncludeClassification;
51+
4952
protected override void ExecuteCmdlet()
5053
{
5154
UnifiedGroupEntity group = null;
@@ -58,7 +61,7 @@ protected override void ExecuteCmdlet()
5861
else
5962
{
6063
// Retrieve all the groups
61-
groups = UnifiedGroupsUtility.ListUnifiedGroups(AccessToken, includeSite: !ExcludeSiteUrl.IsPresent);
64+
groups = UnifiedGroupsUtility.ListUnifiedGroups(AccessToken, includeSite: !ExcludeSiteUrl.IsPresent, includeClassification:IncludeClassification.IsPresent);
6265
}
6366

6467
if (group != null)

0 commit comments

Comments
 (0)