From 3ef16b67c60c3fa7c5a750dde0ac1dec697ab482 Mon Sep 17 00:00:00 2001 From: Koen Zomers Date: Fri, 11 Oct 2024 10:49:01 +0200 Subject: [PATCH 1/2] Code changes and some cleanup --- CHANGELOG.md | 1 + documentation/Set-PnPSite.md | 15 +++++++++++++++ src/Commands/Site/GetSite.cs | 5 +---- src/Commands/Site/SetSite.cs | 9 +++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51c7d4626..af83392d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `Remove-PnPTenantRestrictedSearchAllowedList` cmdlet to removes site URLs from the allowed list when Restricted SharePoint Search is enabled. [#4399](https://github.com/pnp/powershell/pull/4399) - Added `Get-PnPDeletedFlow` cmdlet to retrieve a list of flows which are soft deleted. [#4396](https://github.com/pnp/powershell/pull/4396) - 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 ### 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(); From b5cd745365c93c1ed62e2c92235204e519b4378e Mon Sep 17 00:00:00 2001 From: Koen Zomers Date: Fri, 11 Oct 2024 10:50:03 +0200 Subject: [PATCH 2/2] Added PR reference --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af83392d1..15a6c8e14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `Remove-PnPTenantRestrictedSearchAllowedList` cmdlet to removes site URLs from the allowed list when Restricted SharePoint Search is enabled. [#4399](https://github.com/pnp/powershell/pull/4399) - Added `Get-PnPDeletedFlow` cmdlet to retrieve a list of flows which are soft deleted. [#4396](https://github.com/pnp/powershell/pull/4396) - 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 +- 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