Skip to content

Commit 8b129ab

Browse files
authored
Merge pull request #3599 from wilecoyotegenius/add-set-pnpcompliancetagonbulkitems-cmdlet
Add Set-PnPComplianceTagOnBulkItems cmdlet
2 parents cb9c7ae + 891cffc commit 8b129ab

File tree

12 files changed

+476
-196
lines changed

12 files changed

+476
-196
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2626
- Added `Restore-PnPDeletedContainer` cmdlet which recovers a deleted Container from the Recycle Bin. [#3661](https://github.com/pnp/powershell/pull/3661)
2727
- Added `Get-PnPWebPermission` cmdlet which retrieves permission given by user for specific web. [#3685](https://github.com/pnp/powershell/pull/3685)
2828
- Added `-HorizontalQuickLaunch` parameter to `Set-PnPWeb` cmdlet to allow navigation orientation to be horizontal. [#3722](https://github.com/pnp/powershell/pull/3722)
29+
- Added `Set-PnPRetentionLabel` and `Reset-PnPRetentionLabel` cmdlets to support setting a retention label on one or more items [#3599](https://github.com/pnp/powershell/pull/3599)
2930

3031
### Fixed
3132

@@ -43,6 +44,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
4344

4445
### Contributors
4546

47+
- Konrad K. [wilecoyotegenius]
4648
- Leon Armston [LeonArmston]
4749
- Daniel Cecil [danielcecil]
4850
- Rohit Devmore [rohit404404]
@@ -99,10 +101,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
99101
- Added support for executing the 'Invoke-PnPSPRestMethod' cmdlet in a batch [#3565](https://github.com/pnp/powershell/pull/3565)
100102
- Added `Get-PnPSiteSetVersionPolicyProgress` cmdlet which allows for getting the progress of setting a version policy for existing document libraries on a site [#3564](https://github.com/pnp/powershell/pull/3564)
101103
- Added `EnableSensitivityLabelForPDF` to `Set-PnPTenant` and `Get-PnPTenant` [#3581](https://github.com/pnp/powershell/pull/3581)
104+
- Changed `Restore-PnPRecycleBinItem` , made `-Identity` parameter as non-mandatory. [#2499](https://github.com/pnp/powershell/pull/2499)
102105
- Added the ability to set Manage and FullControl permissions directly when using Sites.Selected with `Grant-PnPAzureADAppSitePermission` [#3617](https://github.com/pnp/powershell/pull/3617)
103106
- Added `Remove-PnPMicrosoft365GroupPhoto` cmdlet which allows removal of profile picture of M365 Group. [#3607](https://github.com/pnp/powershell/pull/3607)
104107

105-
106108
### Fixed
107109

108110
- Fixed `Add-PnPContentTypeToList` cmdlet to better handle piped lists. [#3244](https://github.com/pnp/powershell/pull/3244)
@@ -455,7 +457,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
455457
- Improved `Remove-PnPFieldFromContentType` cmdlet to ensure proper null check for non-existing fields. It will now throw proper `Field not found` error. [#2407](https://github.com/pnp/powershell/pull/2407)
456458
- Changed the Microsoft 365 Groups cmdlets to use the `v1.0` endpoint instead of the `beta` [#2426](https://github.com/pnp/powershell/pull/2426)
457459
- Changed `Add-PnPMicrosoft365GroupToSite` to longer require the `-Url` parameter to be specified. If its not provided, the currently connected to site will be groupified. [#2496](https://github.com/pnp/powershell/pull/2496)
458-
- Changed `Restore-PnPRecycleBinItem` , made `-Identity` parameter as non-mandatory. [#2499](https://github.com/pnp/powershell/pull/2499)
459460

460461
### Removed
461462

documentation/Get-PnPRetentionLabel.md renamed to documentation/Get-PnPTenantRetentionLabel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: Get-PnPRetentionLabel
1010
# Get-PnPRetentionLabel
1111

1212
## SYNOPSIS
13-
Gets the Microsoft Purview retention labels that are within the tenant
13+
Gets the Microsoft Purview retention labels that are available within the tenant
1414

1515
## SYNTAX
1616

documentation/Reset-PnPLabel.md

Lines changed: 0 additions & 90 deletions
This file was deleted.
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
Module Name: PnP.PowerShell
3+
title: Reset-PnPRetentionLabel
4+
schema: 2.0.0
5+
applicable: SharePoint Online
6+
external help file: PnP.PowerShell.dll-Help.xml
7+
online version: https://pnp.github.io/powershell/cmdlets/Reset-PnPRetentionLabel.html
8+
---
9+
10+
# Reset-PnPRetentionLabel
11+
12+
## SYNOPSIS
13+
Resets a retention label on the specified list or library to None, or resets a retention label on specified list items in a list or a library
14+
15+
## SYNTAX
16+
17+
### Reset on a list
18+
```powershell
19+
Reset-PnPRetentionLabel [-List] <ListPipeBind> [-SyncToItems <Boolean>]
20+
[-Connection <PnPConnection>]
21+
```
22+
23+
### Reset on items in bulk
24+
```powershell
25+
Reset-PnPRetentionLabel [-List] <ListPipeBind> -ItemIds <List<Int32>> [-BatchSize <Int32>]
26+
[-Connection <PnPConnection>] [-Verbose]
27+
```
28+
29+
## DESCRIPTION
30+
Removes the retention label on a list or library and its items, or removes the retention label from specified items in a list or a library. Does not work for sensitivity labels.
31+
When resetting retention label on specified items, cmdlet allows passing of unlimited number of items - items will be split and processed in batches (CSOM method SetComplianceTagOnBulkItems has a hard count limit on number of processed items in one go). If needed, batch size may be adjusted with BatchSize parameter.
32+
33+
## EXAMPLES
34+
35+
### EXAMPLE 1
36+
```powershell
37+
Reset-PnPRetentionLabel -List "Demo List"
38+
```
39+
40+
This resets an O365 label on the specified list or library to None
41+
42+
### EXAMPLE 2
43+
```powershell
44+
Reset-PnPRetentionLabel -List "Demo List" -SyncToItems $true
45+
```
46+
47+
This resets an O365 label on the specified list or library to None and resets the label on all the items in the list and library except Folders and where the label has been manually or previously automatically assigned
48+
49+
### EXAMPLE 3
50+
```powershell
51+
Set-PnPRetentionLabel -List "Demo List" -ItemIds @(1,2,3)
52+
```
53+
54+
This clears a retention label from items with ids 1, 2 and 3 on a list "Demo List"
55+
56+
## PARAMETERS
57+
58+
### -BatchSize
59+
Optional batch size when resetting a label on specified items.
60+
61+
```yaml
62+
Type: Int32
63+
Parameter Sets: (BulkItems)
64+
65+
Required: True
66+
Position: Named
67+
Default value: 25
68+
Accept pipeline input: False
69+
Accept wildcard characters: False
70+
```
71+
72+
### -Connection
73+
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.
74+
75+
```yaml
76+
Type: PnPConnection
77+
Parameter Sets: (All)
78+
79+
Required: False
80+
Position: Named
81+
Default value: None
82+
Accept pipeline input: False
83+
Accept wildcard characters: False
84+
```
85+
86+
### -ItemIds
87+
List of iist item IDs to reset label.
88+
89+
```yaml
90+
Type: List<Int32>
91+
Parameter Sets: (BulkItems)
92+
93+
Required: True
94+
Position: Named
95+
Default value: None
96+
Accept pipeline input: False
97+
Accept wildcard characters: False
98+
```
99+
100+
### -List
101+
The ID or Url of the list
102+
103+
```yaml
104+
Type: ListPipeBind
105+
Parameter Sets: (All)
106+
107+
Required: True
108+
Position: 0
109+
Default value: None
110+
Accept pipeline input: True (ByValue)
111+
Accept wildcard characters: False
112+
```
113+
114+
### -SyncToItems
115+
Reset label on existing items in the library
116+
117+
```yaml
118+
Type: Boolean
119+
Parameter Sets: (List)
120+
121+
Required: False
122+
Position: Named
123+
Default value: None
124+
Accept pipeline input: False
125+
Accept wildcard characters: False
126+
```
127+
128+
### -Verbose
129+
When provided, additional debug statements will be shown while executing the cmdlet.
130+
131+
```yaml
132+
Type: SwitchParameter
133+
Parameter Sets: (All)
134+
135+
Required: False
136+
Position: Named
137+
Default value: None
138+
Accept pipeline input: False
139+
Accept wildcard characters: False
140+
141+
142+
## RELATED LINKS
143+
144+
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
145+
[Microsoft Learn article on applying retention labels](https://learn.microsoft.com/en-us/sharepoint/dev/apis/csom-methods-for-applying-retention-labels)
146+
147+

0 commit comments

Comments
 (0)