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 -HidePeoplePreviewingFiles to Set-PnPSite #4416

Merged
merged 4 commits into from
Oct 26, 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 @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Get-PnPDeletedFlow` cmdlet to retrieve a list of flows which are soft deleted. [#4396](https://github.com/pnp/powershell/pull/4396)
- Added `Restore-PnPFlow` cmdlet which allows for undeleting a flow within 21 days of deletion. [#4415](https://github.com/pnp/powershell/pull/4415)
- Added `-ExcludeDeprecated` to `Export-PnpTaxonomy` which allows for deprecated terms to be excluded from the export [#4053](https://github.com/pnp/powershell/pull/4053)
- Added `-HidePeoplePreviewingFiles` to `Set-PnPSite` which allows for hiding the people previewing files feature on a site [#4416](https://github.com/pnp/powershell/pull/4416)

### 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 @@ -310,6 +310,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -HidePeoplePreviewingFiles
Allows hiding of the presence indicators of users simultaneously editing files.

```yaml
Type: String
Parameter Sets: (All)
Aliases: Url

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Identity
The url of the site collection.

Expand Down
5 changes: 1 addition & 4 deletions src/Commands/Site/GetSite.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Microsoft.SharePoint.Client;

using System;
using System.Linq.Expressions;
using System.Management.Automation;

namespace PnP.PowerShell.Commands.Site
Expand All @@ -12,7 +9,7 @@ public class GetSite : PnPRetrievalsCmdlet<Microsoft.SharePoint.Client.Site>
{
protected override void ExecuteCmdlet()
{
DefaultRetrievalExpressions = new Expression<Func<Microsoft.SharePoint.Client.Site, object>>[] { s => s.Url, s => s.CompatibilityLevel };
DefaultRetrievalExpressions = [s => s.Url, s => s.CompatibilityLevel];
var site = ClientContext.Site;
ClientContext.Load(site, RetrievalExpressions);
ClientContext.ExecuteQueryRetry();
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 @@ -127,6 +127,9 @@ public class SetSite : PnPSharePointCmdlet
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public bool? RestrictContentOrgWideSearch;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public bool? HidePeoplePreviewingFiles;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_LOCKSTATE)]
public SwitchParameter Wait;

Expand Down Expand Up @@ -415,6 +418,12 @@ protected override void ExecuteCmdlet()
executeQueryRequired = true;
}

if (ParameterSpecified(nameof(HidePeoplePreviewingFiles)) && HidePeoplePreviewingFiles.HasValue)
{
siteProperties.HidePeoplePreviewingFiles = HidePeoplePreviewingFiles.Value;
executeQueryRequired = true;
}

if (executeQueryRequired)
{
siteProperties.Update();
Expand Down
Loading