diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dcaf5f82..a5376b4cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `-SignInAudience` parameter to `Register-PnPEntraIDApp` and `Register-PnPEntraIDAppForInteractiveLogin` which allows you to make the EntraID app support creation of multi-tenant apps. [#4289](https://github.com/pnp/powershell/pull/4289) - Added `-OutputInstance` parameter to `Export-PnPPage` cmdlet to allow export of the page as in-memory template. [#4323](https://github.com/pnp/powershell/pull/4323) - Added `-X509KeyStorageFlags` parameter to `Connect-PnPOnline` cmdlet which allows setting of how private keys are to be imported. [#4324](https://github.com/pnp/powershell/pull/4324) +- Added `-RestrictContentOrgWideSearch` parameter to `Set-PnPSite` which allows for applying the Restricted Content Discoverability (RCD) setting to a site [#4335](https://github.com/pnp/powershell/pull/4335) ### Changed diff --git a/documentation/Set-PnPSite.md b/documentation/Set-PnPSite.md index 6ac4b9a3d..b209614d9 100644 --- a/documentation/Set-PnPSite.md +++ b/documentation/Set-PnPSite.md @@ -47,6 +47,7 @@ Set-PnPSite [-Identity ] [-BlockDownloadPolicy ] [-ExcludeBlockDownloadPolicySiteOwners ] [-ExcludedBlockDownloadGroupIds ] [-ListsShowHeaderAndNavigation ] + [-RestrictContentOrgWideSearch ] [-Connection ] ``` @@ -543,6 +544,20 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RestrictContentOrgWideSearch +Allows for applying the Restricted Content Discoverability (RCD) setting to a site + +```yaml +Type: Boolean +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -BlockDownloadPolicy Set this to true to block download of files from SharePoint sites or OneDrive diff --git a/src/Commands/Site/SetSite.cs b/src/Commands/Site/SetSite.cs index 556c64df7..45358a637 100644 --- a/src/Commands/Site/SetSite.cs +++ b/src/Commands/Site/SetSite.cs @@ -124,6 +124,9 @@ public class SetSite : PnPSharePointCmdlet [Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)] public bool? ListsShowHeaderAndNavigation; + [Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)] + public bool? RestrictContentOrgWideSearch; + [Parameter(Mandatory = false, ParameterSetName = ParameterSet_LOCKSTATE)] public SwitchParameter Wait; @@ -406,6 +409,12 @@ protected override void ExecuteCmdlet() executeQueryRequired = true; } + if (ParameterSpecified(nameof(RestrictContentOrgWideSearch)) && RestrictContentOrgWideSearch.HasValue) + { + siteProperties.RestrictContentOrgWideSearch = RestrictContentOrgWideSearch.Value; + executeQueryRequired = true; + } + if (executeQueryRequired) { siteProperties.Update();