Skip to content

Commit 67e8c1d

Browse files
gautamdshethGautam Sheth
andauthored
Added -CanSyncHubSitePermissions parameter to Set-PnPSite cmdlet to control syncing of hub site permissions. (#4555)
Co-authored-by: Gautam Sheth <gautam.sheth@staffbase.com>
1 parent a3a387a commit 67e8c1d

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3434
- Added `-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled` to `Set-PnPTenant` which allows for updating of web property bag when DenyAddAndCustomizePages is enabled [#4508](https://github.com/pnp/powershell/pull/4508)
3535
- Added `SiteId` to the output of `Get-PnPTenantSite` [#4527](https://github.com/pnp/powershell/pull/4527)
3636
- Added `Add-PnPFileSensitivityLabel` which allows for assigning sensitivity labels to SharePoint files [#4538](https://github.com/pnp/powershell/pull/4538)
37+
- Added `-CanSyncHubSitePermissions` parameter to `Set-PnPSite` cmdlet to set value of allowing syncing hub site permissions to this associated site.
3738

3839
### Changed
3940

documentation/Set-PnPSite.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Set-PnPSite [-Identity <String>]
4848
[-ExcludedBlockDownloadGroupIds <Guid[]>]
4949
[-ListsShowHeaderAndNavigation <Boolean>]
5050
[-RestrictContentOrgWideSearch <Boolean>]
51+
[-CanSyncHubSitePermissions <SwitchParameter>]
5152
[-Connection <PnPConnection>]
5253
```
5354

@@ -629,6 +630,20 @@ Accept pipeline input: False
629630
Accept wildcard characters: False
630631
```
631632
633+
### -CanSyncHubSitePermissions
634+
Sets value if syncing hub site permissions to this associated site is allowed.
635+
636+
```yaml
637+
Type: Switch Parameter
638+
Parameter Sets: Set Properties
639+
640+
Required: False
641+
Position: Named
642+
Default value: None
643+
Accept pipeline input: False
644+
Accept wildcard characters: False
645+
```
646+
632647
### -Wait
633648
Wait for the operation to complete
634649

src/Commands/Site/SetSite.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ public class SetSite : PnPSharePointCmdlet
130130
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
131131
public bool? HidePeoplePreviewingFiles;
132132

133+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
134+
public SwitchParameter? CanSyncHubSitePermissions;
135+
133136
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_LOCKSTATE)]
134137
public SwitchParameter Wait;
135138

@@ -188,6 +191,12 @@ protected override void ExecuteCmdlet()
188191
}
189192
}
190193

194+
if (ParameterSpecified(nameof(CanSyncHubSitePermissions)) && CanSyncHubSitePermissions.HasValue)
195+
{
196+
site.CanSyncHubSitePermissions = CanSyncHubSitePermissions.Value;
197+
context.ExecuteQueryRetry();
198+
}
199+
191200
if (ParameterSpecified(nameof(LogoFilePath)))
192201
{
193202
if (!System.IO.Path.IsPathRooted(LogoFilePath))
@@ -422,7 +431,7 @@ protected override void ExecuteCmdlet()
422431
{
423432
siteProperties.HidePeoplePreviewingFiles = HidePeoplePreviewingFiles.Value;
424433
executeQueryRequired = true;
425-
}
434+
}
426435

427436
if (executeQueryRequired)
428437
{

0 commit comments

Comments
 (0)