Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added -RestrictContentOrgWideSearch to Set-PnPSite #4335

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 15 additions & 0 deletions documentation/Set-PnPSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Set-PnPSite [-Identity <String>]
[-BlockDownloadPolicy <Boolean>] [-ExcludeBlockDownloadPolicySiteOwners <Boolean>]
[-ExcludedBlockDownloadGroupIds <Guid[]>]
[-ListsShowHeaderAndNavigation <Boolean>]
[-RestrictContentOrgWideSearch <Boolean>]
[-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions src/Commands/Site/SetSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand Down
Loading