Skip to content

Commit f58adad

Browse files
authored
Merge pull request #2939 from ganesh-sanap/DisableListCommenting
Added DisableCommenting parameter to Set-PnPList cmdlet
2 parents f92dacb + e5f2977 commit f58adad

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5757
- Added `CalendarMemberReadOnly` and `ConnectorsDisabled` as `-ResourceBehaviorOptions` to `New-PnPMicrosoft365Group` [#2929](https://github.com/pnp/powershell/pull/2929)
5858
- Added `-Identity` option to `Get-PnPPowerPlatformEnvironment` which allows retrieval of one specific environment by its displayname or id. [#2794](https://github.com/pnp/powershell/pull/2794)
5959
- Added `Get-PnPPowerApp` which allows PowerApps to be retrieved [#2794](https://github.com/pnp/powershell/pull/2794)
60+
- Added `-DisableCommenting` to `Set-PnPList` which allows enabling or disabling commenting on a list. [#2939](https://github.com/pnp/powershell/pull/2939)
6061

6162
### Changed
6263

@@ -107,7 +108,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
107108
- Fixed `Add-PnPFieldFromXml` cmdlet. It will now return the correct typed field if the added field was of type `Taxonomy`. [#2926](https://github.com/pnp/powershell/pull/2926)
108109

109110
### Contributors
110-
111+
- Ganesh Sanap [ganesh-sanap]
111112
- Chris R. [ChrisRo89]
112113
- Aimery Thomas [a1mery]
113114
- Ganesh Sanap [ganesh-sanap]

documentation/Set-PnPList.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Set-PnPList -Identity <ListPipeBind> [-EnableContentTypes <Boolean>] [-BreakRole
2121
[-EnableAttachments <Boolean>] [-EnableFolderCreation <Boolean>] [-EnableVersioning <Boolean>]
2222
[-EnableMinorVersions <Boolean>] [-MajorVersions <UInt32>] [-MinorVersions <UInt32>]
2323
[-EnableModeration <Boolean>] [-DraftVersionVisibility <DraftVisibilityType>] [-ReadSecurity <ListReadSecurity>] [-WriteSecurity <ListWriteSecurity>]
24-
[-NoCrawl] [-ExemptFromBlockDownloadOfNonViewableFiles <Boolean>] [-DisableGridEditing <Boolean>] [-DefaultSensitivityLabelForLibrary <SensitivityLabelPipeBind>]
24+
[-NoCrawl] [-ExemptFromBlockDownloadOfNonViewableFiles <Boolean>] [-DisableGridEditing <Boolean>] [-DisableCommenting <Boolean>] [-DefaultSensitivityLabelForLibrary <SensitivityLabelPipeBind>]
2525
[-Path <String>] [-OpenDocumentsMode <DocumentLibraryOpenDocumentsInMode>] [-Connection <PnPConnection>]
2626
```
2727

@@ -468,6 +468,20 @@ Accept pipeline input: False
468468
Accept wildcard characters: False
469469
```
470470
471+
### -DisableCommenting
472+
Enable or disable whether commenting is enabled for the list. Set to $true to disable, $false to enable.
473+
474+
```yaml
475+
Type: Boolean
476+
Parameter Sets: (All)
477+
478+
Required: False
479+
Position: Named
480+
Default value: None
481+
Accept pipeline input: False
482+
Accept wildcard characters: False
483+
```
484+
471485
### -Path
472486
The new URL path of the list. The parent folder must exist and be in the same site/web. I.e. lists\newname.
473487

src/Commands/Lists/SetList.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ public class SetList : PnPWebCmdlet
8282

8383
[Parameter(Mandatory = false)]
8484
public bool DisableGridEditing;
85+
86+
[Parameter(Mandatory = false)]
87+
public bool DisableCommenting;
8588

8689
[Parameter(Mandatory = false)]
8790
public string Path;
@@ -113,7 +116,7 @@ protected override void ExecuteCmdlet()
113116
list = newIdentity.GetList(CurrentWeb);
114117
}
115118

116-
list.EnsureProperties(l => l.EnableAttachments, l => l.EnableVersioning, l => l.EnableMinorVersions, l => l.Hidden, l => l.EnableModeration, l => l.BaseType, l => l.HasUniqueRoleAssignments, l => l.ContentTypesEnabled, l => l.ExemptFromBlockDownloadOfNonViewableFiles, l => l.DisableGridEditing);
119+
list.EnsureProperties(l => l.EnableAttachments, l => l.EnableVersioning, l => l.EnableMinorVersions, l => l.Hidden, l => l.EnableModeration, l => l.BaseType, l => l.HasUniqueRoleAssignments, l => l.ContentTypesEnabled, l => l.ExemptFromBlockDownloadOfNonViewableFiles, l => l.DisableGridEditing, l => l.DisableCommenting);
117120

118121
var enableVersioning = list.EnableVersioning;
119122
var enableMinorVersions = list.EnableMinorVersions;
@@ -233,6 +236,12 @@ protected override void ExecuteCmdlet()
233236
updateRequired = true;
234237
}
235238

239+
if (ParameterSpecified(nameof(DisableCommenting)))
240+
{
241+
list.DisableCommenting = DisableCommenting;
242+
updateRequired = true;
243+
}
244+
236245
if (updateRequired)
237246
{
238247
list.Update();

0 commit comments

Comments
 (0)