From c1de04a546d3f1428698a0dc0f61f3d733d0216f Mon Sep 17 00:00:00 2001 From: Koen Zomers Date: Tue, 24 Sep 2024 12:35:00 +0200 Subject: [PATCH 1/3] Added RestrictContentOrgWideSearch parameter --- CHANGELOG.md | 1 + src/Commands/Site/SetSite.cs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dcaf5f82..40686721b 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 ### Changed 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(); From 994108c9f5a9936ab5a6a4837a11260fd6aab724 Mon Sep 17 00:00:00 2001 From: Koen Zomers Date: Tue, 24 Sep 2024 12:36:13 +0200 Subject: [PATCH 2/3] Added PR reference --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40686721b..a5376b4cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +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 +- 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 From 0322cef004221dad4828ee4263bb708479304563 Mon Sep 17 00:00:00 2001 From: Koen Zomers Date: Tue, 24 Sep 2024 12:38:01 +0200 Subject: [PATCH 3/3] Adding parameter to documentation --- documentation/Set-PnPSite.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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