diff --git a/CHANGELOG.md b/CHANGELOG.md index 12c52ce18..4526cb4a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/documentation/Set-PnPSite.md b/documentation/Set-PnPSite.md index b209614d9..250cb8b1a 100644 --- a/documentation/Set-PnPSite.md +++ b/documentation/Set-PnPSite.md @@ -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. diff --git a/src/Commands/Site/GetSite.cs b/src/Commands/Site/GetSite.cs index fafd6c303..1cb648813 100644 --- a/src/Commands/Site/GetSite.cs +++ b/src/Commands/Site/GetSite.cs @@ -1,7 +1,4 @@ using Microsoft.SharePoint.Client; - -using System; -using System.Linq.Expressions; using System.Management.Automation; namespace PnP.PowerShell.Commands.Site @@ -12,7 +9,7 @@ public class GetSite : PnPRetrievalsCmdlet { protected override void ExecuteCmdlet() { - DefaultRetrievalExpressions = new Expression>[] { s => s.Url, s => s.CompatibilityLevel }; + DefaultRetrievalExpressions = [s => s.Url, s => s.CompatibilityLevel]; var site = ClientContext.Site; ClientContext.Load(site, RetrievalExpressions); ClientContext.ExecuteQueryRetry(); diff --git a/src/Commands/Site/SetSite.cs b/src/Commands/Site/SetSite.cs index 45358a637..d1efe0f1d 100644 --- a/src/Commands/Site/SetSite.cs +++ b/src/Commands/Site/SetSite.cs @@ -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; @@ -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();