You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set AutoExpiration file version trim mode for a site. The new document libraries will use this version setting. Also create a request to set the file version trim mode as AutoExpiration for existing document libraries that enabled versioning.
40
+
This example sets AutoExpiration file version trim mode for a site. The new document libraries will use this version setting. Also creates a request to set the file version trim mode as AutoExpiration for existing document libraries that enabled versioning.
Set ExpireAfter file version trim mode for a site. The new document libraries will use this version setting. Also create a request to set the file version trim mode as ExpireAfter for existing document libraries that enabled versioning.
47
+
This example sets ExpireAfter file version trim mode for a site. The new document libraries will use this version setting. Also creates a request to set the file version trim mode as ExpireAfter for existing document libraries that enabled versioning.
Set NoExpiration file version trim mode for a site. The new document libraries will use this version setting. Also create a request to set the file version trim mode as NoExpiration for existing document libraries that enabled versioning.
54
+
Example 3 sets NoExpiration file version trim mode for a site. The new document libraries will use this version setting. Also creates a request to set the file version trim mode as NoExpiration for existing document libraries that enabled versioning.
52
55
53
56
### EXAMPLE 4
54
57
```powershell
55
58
Set-PnPSiteVersionPolicy -InheritFromTenant
56
59
```
57
60
58
-
Clear the file version setting on a site. The new document libraries will use the tenant level setting.
61
+
Example 4 clears the file version setting on a site. The new document libraries will use the tenant level setting.
Cancel the existing request which sets the file version trim mode for existing document libraries on a site.
110
+
This example cancels the existing request which sets the file version trim mode for existing document libraries on a site.
108
111
109
112
## PARAMETERS
110
113
111
-
### -EnableAutoExpirationVersionTrim
112
-
Enable or disable AutoExpiration version trim for the document libraries on the site. Set to $true to enable, $false to disable.
114
+
### -ApplyToNewDocumentLibraries
115
+
Sets site version policy for new document libraries. Works with parameters EnableAutoExpirationVersionTrim, ExpireVersionsAfterDays, MajorVersions and MajorWithMinorVersions.
113
116
114
-
Parameter ExpireVersionsAfterDays is required when EnableAutoExpirationVersionTrim is false. Set it to 0 for NoExpiration, set it to greater or equal to 30 for ExpireAfter.
117
+
```yaml
118
+
Type: SwitchParameter
119
+
Parameter Sets: Set Properties
115
120
116
-
Parameter MajorVersions is required when EnableAutoExpirationVersionTrim is false.
121
+
Required: False
122
+
Position: Named
123
+
Default value: None
124
+
Accept pipeline input: False
125
+
Accept wildcard characters: False
126
+
```
117
127
118
-
Parameter MajorWithMinorVersions is required when EnableAutoExpirationVersionTrim is false and the setting is for document libraries that including existing ones. It is used when minor version is enabled on the document libraries.
128
+
### -ApplyToExistingDocumentLibraries
129
+
Creates a request to set the file version trim mode for existing document libraries that enabled versioning. Works with parameters EnableAutoExpirationVersionTrim, ExpireVersionsAfterDays, MajorVersions and MajorWithMinorVersions.
Maximum major versions to keep. Work with parameter EnableAutoExpirationVersionTrim. Please see description in EnableAutoExpirationVersionTrim.
156
+
### -Connection
157
+
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.
Maximum major versions for which to keep minor versions. Work with parameter EnableAutoExpirationVersionTrim. Please see description in EnableAutoExpirationVersionTrim.
170
+
### -EnableAutoExpirationVersionTrim
171
+
Enables or disables AutoExpiration version trim for the document libraries on the site. Set to $true to enable, $false to disable.
172
+
173
+
Parameter ExpireVersionsAfterDays is required when EnableAutoExpirationVersionTrim is false. Set it to 0 for NoExpiration, set it to greater or equal to 30 for ExpireAfter.
174
+
175
+
Parameter MajorVersions is required when EnableAutoExpirationVersionTrim is false.
176
+
177
+
Parameter MajorWithMinorVersions is required when EnableAutoExpirationVersionTrim is false and the setting is for document libraries that including existing ones. It is used when minor version is enabled on the document libraries.
Clear the file version setting on a site. The new document libraries will use the tenant level setting.
190
+
### -ExpireVersionsAfterDays
191
+
Expires the version after the days. Works with parameter EnableAutoExpirationVersionTrim. Please see description in EnableAutoExpirationVersionTrim.
175
192
176
193
```yaml
177
-
Type: SwitchParameter
194
+
Type: UInt32
178
195
Parameter Sets: Set Properties
179
196
180
197
Required: False
@@ -184,8 +201,8 @@ Accept pipeline input: False
184
201
Accept wildcard characters: False
185
202
```
186
203
187
-
### -ApplyToNewDocumentLibraries
188
-
Set site version policy for new document libraries. Work with parameters EnableAutoExpirationVersionTrim, ExpireVersionsAfterDays, MajorVersions and MajorWithMinorVersions.
204
+
### -InheritFromTenant
205
+
Clears the file version setting on a site. The new document libraries will use the tenant level setting.
Create a request to set the file version trim mode for existing document libraries that enabled versioning. Work with parameters EnableAutoExpirationVersionTrim, ExpireVersionsAfterDays, MajorVersions and MajorWithMinorVersions.
218
+
### -MajorVersions
219
+
Maximum major versions to keep. Works with parameter EnableAutoExpirationVersionTrim. Please see description in EnableAutoExpirationVersionTrim.
Cancel the existing request which sets the file version trim mode for existing document libraries on a site.
232
+
### -MajorWithMinorVersions
233
+
Maximum major versions for which to keep minor versions. Works with parameter EnableAutoExpirationVersionTrim. Please see description in EnableAutoExpirationVersionTrim.
217
234
218
235
```yaml
219
-
Type: SwitchParameter
236
+
Type: UInt32
220
237
Parameter Sets: Set Properties
221
238
222
239
Required: False
@@ -226,6 +243,7 @@ Accept pipeline input: False
226
243
Accept wildcard characters: False
227
244
```
228
245
246
+
229
247
## RELATED LINKS
230
248
231
249
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
@@ -39,41 +39,41 @@ This example disables caching for all webs in the site collection https://contos
39
39
40
40
## PARAMETERS
41
41
42
-
### -IsEnabled
43
-
$true to enable caching, $false to disable caching.
42
+
### -Connection
43
+
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.
44
44
45
45
```yaml
46
-
Type: Boolean
46
+
Type: PnPConnection
47
47
Parameter Sets: (All)
48
-
Aliases:
49
-
Required: True
48
+
49
+
Required: False
50
50
Position: Named
51
51
Default value: None
52
52
Accept pipeline input: False
53
53
Accept wildcard characters: False
54
54
```
55
55
56
-
### -SiteUrl
57
-
Specifies the absolute URL for the site collection's root web that needs its caching state to be set.
56
+
### -IsEnabled
57
+
$true to enable caching, $false to disable caching.
58
58
59
59
```yaml
60
-
Type: String
60
+
Type: Boolean
61
61
Parameter Sets: (All)
62
62
Aliases:
63
-
Required: False
63
+
Required: True
64
64
Position: Named
65
65
Default value: None
66
66
Accept pipeline input: False
67
67
Accept wildcard characters: False
68
68
```
69
69
70
-
### -Connection
71
-
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.
70
+
### -SiteUrl
71
+
Specifies the absolute URL for the site collection's root web that needs its caching state to be set.
0 commit comments