Skip to content

Commit 14a34b6

Browse files
committed
Add support for -ClearGroupId parameter in Set-PnPSite and Set-PnPTenantSite cmdlets
1 parent af7fc76 commit 14a34b6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2525
- Added `Import-PnPFlow` cmdlet to import Power Automate in the tenant. [#4854](https://github.com/pnp/powershell/pull/4854)
2626
- Marked `-Force` as obsolete within Enable-PnPFeature cmdlet . [#5146](https://github.com/pnp/powershell/pull/5146)
2727
- Added `Remove-PnPPowerAppPermission` cmdlet to remove Power Apps permissions. [#5168](https://github.com/pnp/powershell/pull/5168)
28+
- Added support for `-ClearGroupId` parameter in `Set-PnPSite` and `Set-PnPTenantSite` cmdlets. [#5192](https://github.com/pnp/powershell/pull/5192)
2829

2930
### Changed
3031
- Improved `Get-PnPTerm` cmdlet to show a better error message. [#4933](https://github.com/pnp/powershell/pull/4933)

src/Commands/Site/SetSite.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public class SetSite : PnPSharePointCmdlet
141141
public SwitchParameter ReadOnlyForBlockDownloadPolicy;
142142

143143
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
144-
public SwitchParameter? ClearGroupId;
144+
public SwitchParameter ClearGroupId;
145145

146146
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_LOCKSTATE)]
147147
public SwitchParameter Wait;
@@ -461,9 +461,9 @@ protected override void ExecuteCmdlet()
461461
executeQueryRequired = true;
462462
}
463463

464-
if (ClearGroupId.HasValue)
464+
if (ParameterSpecified(nameof(ClearGroupId)) && ClearGroupId.IsPresent)
465465
{
466-
siteProperties.ClearGroupId = ClearGroupId.Value;
466+
siteProperties.ClearGroupId = ClearGroupId.ToBool();
467467
executeQueryRequired = true;
468468
}
469469

@@ -527,6 +527,6 @@ private bool IsTenantProperty() =>
527527
HidePeopleWhoHaveListsOpen.HasValue ||
528528
ParameterSpecified(nameof(ExcludeBlockDownloadSharePointGroups)) ||
529529
ReadOnlyForBlockDownloadPolicy.IsPresent ||
530-
ClearGroupId.HasValue;
530+
ClearGroupId.IsPresent;
531531
}
532532
}

0 commit comments

Comments
 (0)