Skip to content

Commit f92add7

Browse files
Learn Editor: Update New-SPOListFileVersionBatchDeleteJob.md
1 parent 5604501 commit f92add7

1 file changed

Lines changed: 104 additions & 0 deletions

File tree

sharepoint/sharepoint-ps/Microsoft.Online.SharePoint.PowerShell/New-SPOListFileVersionBatchDeleteJob.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ New-SPOListFileVersionBatchDeleteJob [-Site] <SpoSitePipeBind> -List <SPOListPip
3737
-MajorVersionLimit <Int32> -MajorWithMinorVersionsLimit <Int32> [-WhatIf] [-Confirm] [<CommonParameters>]
3838
```
3939

40+
### ByPolicy
41+
```
42+
New-SPOListFileVersionBatchDeleteJob [-Site] <SpoSitePipeBind> -List <SPOListPipeBind> [-FileTypes <String[]>]
43+
[-ExcludeDefaultPolicy] [-TrimUseListPolicy] [-WhatIf] [-Confirm] [<CommonParameters>]
44+
```
45+
4046
## DESCRIPTION
4147

4248
Queues a job to trim versions from a document library.
@@ -69,6 +75,46 @@ New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/
6975

7076
Example 3 starts a trim job that will delete file versions in the document library called "Documents" based on the version count limits.
7177

78+
### EXAMPLE 4
79+
80+
```powershell
81+
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -TrimUseListPolicy
82+
```
83+
84+
Example 4 starts a trim job that will delete file versions in the document library called "Documents" based on the version history limits of the document library.
85+
86+
### EXAMPLE 5
87+
88+
```powershell
89+
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -TrimUseListPolicy -FileTypes @("Video", "Audio")
90+
```
91+
92+
Example 5 starts a trim job that will delete file versions for video and audio file types, and file versions that do not belong to a file type override in the document library based on the version history limits of the document library.
93+
94+
### EXAMPLE 6
95+
96+
```powershell
97+
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -TrimUseListPolicy -FileTypes @("Video", "Audio") -ExcludeDefaultPolicy
98+
```
99+
100+
Example 6 starts a trim job that will delete file versions for video and audio file types in the document library based on the version history limits of the document library.
101+
102+
### EXAMPLE 7
103+
104+
```powershell
105+
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -TrimUseListPolicy -ExcludeDefaultPolicy
106+
```
107+
108+
Example 7 starts a trim job that will delete file versions for all file types that have a version history limit override in the document library based on the version history limits of the document library.
109+
110+
### EXAMPLE 8
111+
112+
```powershell
113+
New-SPOListFileVersionBatchDeleteJob -Site https://contoso.sharepoint.com/sites/site1 -List "Documents" -TrimUseListPolicy -FileTypes @()
114+
```
115+
116+
Example 8 starts a trim job that will delete file versions for all file types that don't have a version history limit override in the document library based on the version history limits of the document library.
117+
72118
## PARAMETERS
73119

74120
### -Automatic
@@ -101,6 +147,47 @@ Accept pipeline input: False
101147
Accept wildcard characters: False
102148
```
103149
150+
### -ExcludeDefaultPolicy
151+
Indicates whether to trim versions based on the default version history limits.
152+
153+
> [!NOTE]
154+
> This feature is currently in preview and may not be available in your tenant.
155+
156+
```yaml
157+
Type: SwitchParameter
158+
Parameter Sets: ByPolicy
159+
Aliases:
160+
161+
Required: False
162+
Position: Named
163+
Default value: None
164+
Accept pipeline input: False
165+
Accept wildcard characters: False
166+
```
167+
168+
### -FileTypes
169+
An array of file type names to trim versions. The supported file type names are:
170+
171+
- Audio
172+
173+
- OutlookPST
174+
175+
- Video
176+
177+
178+
179+
```yaml
180+
Type: String[]
181+
Parameter Sets: ByPolicy
182+
Aliases:
183+
184+
Required: False
185+
Position: Named
186+
Default value: None
187+
Accept pipeline input: False
188+
Accept wildcard characters: False
189+
```
190+
104191
### -List
105192
106193
The document library name or Id.
@@ -180,6 +267,23 @@ Accept pipeline input: False
180267
Accept wildcard characters: False
181268
```
182269

270+
### -TrimUseListPolicy
271+
Indicates whether to trim versions by applying the document library's version history limits.
272+
273+
274+
275+
```yaml
276+
Type: SwitchParameter
277+
Parameter Sets: ByPolicy
278+
Aliases:
279+
280+
Required: False
281+
Position: Named
282+
Default value: None
283+
Accept pipeline input: False
284+
Accept wildcard characters: False
285+
```
286+
183287
### -WhatIf
184288
Shows what would happen if the cmdlet runs.
185289
The cmdlet is not run.

0 commit comments

Comments
 (0)