-
Notifications
You must be signed in to change notification settings - Fork 405
Add site version policy management features to Set-PnPTenantSite and related commands #5300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,231
−14
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
| --- | ||
| Module Name: PnP.PowerShell | ||
| schema: 2.0.0 | ||
| applicable: SharePoint Online | ||
| online version: https://pnp.github.io/powershell/cmdlets/New-PnPSiteManageVersionPolicyJob.html | ||
| external help file: PnP.PowerShell.dll-Help.xml | ||
| title: New-PnPSiteManageVersionPolicyJob | ||
| --- | ||
|
|
||
| # New-PnPSiteManageVersionPolicyJob | ||
|
|
||
| ## SYNOPSIS | ||
|
|
||
| Starts a site-level version policy management job for a SharePoint Online site collection. | ||
|
|
||
| ## SYNTAX | ||
|
|
||
| ### TrimUseListPolicy | ||
|
|
||
| ```powershell | ||
| New-PnPSiteManageVersionPolicyJob -Identity <SitePipeBind> -TrimUseListPolicy [-SyncListPolicy] [-FileTypes <String[]>] [-ExcludeDefaultPolicy] [-NoWait] [-Force] [-Connection <PnPConnection>] | ||
| ``` | ||
|
|
||
| ### SyncListPolicy | ||
|
|
||
| ```powershell | ||
| New-PnPSiteManageVersionPolicyJob -Identity <SitePipeBind> -SyncListPolicy [-FileTypes <String[]>] [-ExcludeDefaultPolicy] [-NoWait] [-Force] [-Connection <PnPConnection>] | ||
| ``` | ||
|
|
||
| ## DESCRIPTION | ||
|
|
||
| Starts a site-level job that can trim versions using existing list version policies, synchronize list version policies across libraries, or do both in a single operation. By default, the cmdlet waits for the tenant operation to complete. Use `-NoWait` to return immediately after the job has been queued. | ||
|
|
||
| ## EXAMPLES | ||
|
|
||
| ### EXAMPLE 1 | ||
| ```powershell | ||
| New-PnPSiteManageVersionPolicyJob -Identity "https://contoso.sharepoint.com/sites/project-x" -SyncListPolicy | ||
| ``` | ||
|
|
||
| Queues a site-level job that synchronizes list version policies across the target site collection. | ||
|
|
||
| ### EXAMPLE 2 | ||
| ```powershell | ||
| New-PnPSiteManageVersionPolicyJob -Identity "https://contoso.sharepoint.com/sites/project-x" -TrimUseListPolicy -SyncListPolicy -Force | ||
| ``` | ||
|
|
||
| Queues a site-level job that trims versions using each library's list version policy and then synchronizes list version policies across the site collection, without prompting for confirmation. | ||
|
|
||
| ### EXAMPLE 3 | ||
| ```powershell | ||
| New-PnPSiteManageVersionPolicyJob -Identity "https://contoso.sharepoint.com/sites/project-x" -TrimUseListPolicy -FileTypes "pdf","docx" -ExcludeDefaultPolicy -NoWait | ||
| ``` | ||
|
|
||
| Queues a site-level job that trims versions only for the specified file types, excludes the default policy, and returns immediately without waiting for the tenant operation to complete. | ||
|
|
||
| ## PARAMETERS | ||
|
|
||
| ### -Connection | ||
| 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. | ||
|
|
||
| ```yaml | ||
| Type: PnPConnection | ||
| Parameter Sets: (All) | ||
|
|
||
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -ExcludeDefaultPolicy | ||
| Excludes the default version policy from the site management job. This can be combined with `-FileTypes` to target only specific file types. | ||
|
|
||
| ```yaml | ||
| Type: SwitchParameter | ||
| Parameter Sets: (All) | ||
|
|
||
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -FileTypes | ||
| The file types to include in the version policy management job. When omitted, all file types are included. | ||
|
|
||
| ```yaml | ||
| Type: String[] | ||
| Parameter Sets: (All) | ||
|
|
||
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -Force | ||
| When provided together with `-TrimUseListPolicy`, no confirmation prompt will be shown before creating the job. | ||
|
|
||
| ```yaml | ||
| Type: SwitchParameter | ||
| Parameter Sets: (All) | ||
|
|
||
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -Identity | ||
| The site collection on which to run the version policy management job. | ||
|
|
||
| ```yaml | ||
| Type: SitePipeBind | ||
| Parameter Sets: (All) | ||
|
|
||
| Required: True | ||
| Position: 0 | ||
| Default value: None | ||
| Accept pipeline input: True | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -NoWait | ||
| Queues the version policy management job and returns immediately instead of waiting for the SharePoint Online tenant operation to complete. | ||
|
|
||
| ```yaml | ||
| Type: SwitchParameter | ||
| Parameter Sets: (All) | ||
|
|
||
| Required: False | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -SyncListPolicy | ||
| Synchronizes the list version policies across document libraries in the site collection. | ||
|
|
||
| ```yaml | ||
| Type: SwitchParameter | ||
| Parameter Sets: TrimUseListPolicy, SyncListPolicy | ||
|
|
||
| Required: True (SyncListPolicy), False (TrimUseListPolicy) | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ### -TrimUseListPolicy | ||
| Trims file versions using the existing version policy configured on each document library in the site collection. | ||
|
|
||
| ```yaml | ||
| Type: SwitchParameter | ||
| Parameter Sets: TrimUseListPolicy | ||
|
|
||
| Required: True | ||
| Position: Named | ||
| Default value: None | ||
| Accept pipeline input: False | ||
| Accept wildcard characters: False | ||
| ``` | ||
|
|
||
| ## RELATED LINKS | ||
|
|
||
| [Get-PnPSiteFileVersionBatchDeleteJobStatus](Get-PnPSiteFileVersionBatchDeleteJobStatus.md) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changelog line now attributes the existing
Get-PnPListVersionPolicy/Set-PnPListVersionPolicycmdlets to PR #5300, but this PR’s diff doesn’t include changes for those cmdlets. Please avoid re-pointing existing changelog entries to an unrelated PR; instead, keep the original PR reference and add only new entries relevant to this PR.