Skip to content

Commit 0ced19b

Browse files
Added -HidePeoplePreviewingFiles to Set-PnPSite (#4416)
* Code changes and some cleanup * Added PR reference --------- Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>
1 parent ca68872 commit 0ced19b

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2929
- Added `Get-PnPDeletedFlow` cmdlet to retrieve a list of flows which are soft deleted. [#4396](https://github.com/pnp/powershell/pull/4396)
3030
- Added `Restore-PnPFlow` cmdlet which allows for undeleting a flow within 21 days of deletion. [#4415](https://github.com/pnp/powershell/pull/4415)
3131
- Added `-ExcludeDeprecated` to `Export-PnpTaxonomy` which allows for deprecated terms to be excluded from the export [#4053](https://github.com/pnp/powershell/pull/4053)
32+
- 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)
3233

3334
### Changed
3435

documentation/Set-PnPSite.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,21 @@ Accept pipeline input: False
310310
Accept wildcard characters: False
311311
```
312312
313+
### -HidePeoplePreviewingFiles
314+
Allows hiding of the presence indicators of users simultaneously editing files.
315+
316+
```yaml
317+
Type: String
318+
Parameter Sets: (All)
319+
Aliases: Url
320+
321+
Required: False
322+
Position: Named
323+
Default value: None
324+
Accept pipeline input: False
325+
Accept wildcard characters: False
326+
```
327+
313328
### -Identity
314329
The url of the site collection.
315330

src/Commands/Site/GetSite.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
using Microsoft.SharePoint.Client;
2-
3-
using System;
4-
using System.Linq.Expressions;
52
using System.Management.Automation;
63

74
namespace PnP.PowerShell.Commands.Site
@@ -12,7 +9,7 @@ public class GetSite : PnPRetrievalsCmdlet<Microsoft.SharePoint.Client.Site>
129
{
1310
protected override void ExecuteCmdlet()
1411
{
15-
DefaultRetrievalExpressions = new Expression<Func<Microsoft.SharePoint.Client.Site, object>>[] { s => s.Url, s => s.CompatibilityLevel };
12+
DefaultRetrievalExpressions = [s => s.Url, s => s.CompatibilityLevel];
1613
var site = ClientContext.Site;
1714
ClientContext.Load(site, RetrievalExpressions);
1815
ClientContext.ExecuteQueryRetry();

src/Commands/Site/SetSite.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public class SetSite : PnPSharePointCmdlet
127127
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
128128
public bool? RestrictContentOrgWideSearch;
129129

130+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
131+
public bool? HidePeoplePreviewingFiles;
132+
130133
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_LOCKSTATE)]
131134
public SwitchParameter Wait;
132135

@@ -415,6 +418,12 @@ protected override void ExecuteCmdlet()
415418
executeQueryRequired = true;
416419
}
417420

421+
if (ParameterSpecified(nameof(HidePeoplePreviewingFiles)) && HidePeoplePreviewingFiles.HasValue)
422+
{
423+
siteProperties.HidePeoplePreviewingFiles = HidePeoplePreviewingFiles.Value;
424+
executeQueryRequired = true;
425+
}
426+
418427
if (executeQueryRequired)
419428
{
420429
siteProperties.Update();

0 commit comments

Comments
 (0)