Skip to content

Commit

Permalink
Merge pull request #3828 from msjennywu/BatchDeleteCmdletUpdate
Browse files Browse the repository at this point in the history
[FileVersion] Add and update batch delete cmdlets
  • Loading branch information
KoenZomers authored Apr 8, 2024
2 parents a8542c5 + 7c4dbad commit ea27043
Show file tree
Hide file tree
Showing 20 changed files with 632 additions and 169 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added additional permissions for Graph application permission validate sets. [#3835](https://github.com/pnp/powershell/issues/3835)
- Added the ability to upload entire local folders with files and optionally subfolders to SharePoint Online into 'Copy-PnPFolder' [#3850](https://github.com/pnp/powershell/pull/3850)
- Added `LoopDefaultSharingLinkRole`, `DefaultShareLinkScope`, `DefaultShareLinkRole`, `LoopDefaultSharingLinkScope` and `DefaultLinkToExistingAccessReset` parameters to `Set-PnPTenant` cmdlet. [#3874](https://github.com/pnp/powershell/pull/3874)
- Added `Get-PnPLibraryFileVersionBatchDeleteJobStatus` and `Get-PnPSiteFileVersionBatchDeleteJobStatus` to check on the status of applying file based version expiration based on age on a library and site level [#3828](https://github.com/pnp/powershell/pull/3828)

### Fixed

- Fixed `Get-PnPChangeLog -Version 2.3.0` not returning the changelog for that version [#3804](https://github.com/pnp/powershell/pull/3804)
- Fixed `Get-PnPFlow` cmdlet throwing time out error due to incorrect URL used in HTTP request. [#3820](https://github.com/pnp/powershell/pull/3820)
- Fixed `Copy-PnPList` cmdlet to better handle lookup columns. [#3870](https://github.com/pnp/powershell/pull/3870)

## Changed
- Renamed `Get-PnPSiteFileVersionExpirationReportJobProgress` to `Get-PnPSiteFileVersionExpirationReportJobStatus` [#3828](https://github.com/pnp/powershell/pull/3828)
- Renamed `Get-PnPSiteVersionPolicyProgress` to `Get-PnPSiteVersionPolicyStatus` [#3828](https://github.com/pnp/powershell/pull/3828)

### Contributors

- Jenny Wu [msjennywu]
- Reshmee Auckloo [reshme011]
- Aimery Thomas [a1mery]
- Arleta Wanat [PowershellScripts]
Expand Down
65 changes: 65 additions & 0 deletions documentation/Get-PnPLibraryFileVersionBatchDeleteJobStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPLibraryFileVersionBatchDeleteJobStatus.html
external help file: PnP.PowerShell.dll-Help.xml
title: Get-PnPLibraryFileVersionBatchDeleteJobStatus
---

# Get-PnPLibraryFileVersionBatchDeleteJobStatus

## SYNOPSIS
Get the progress of deleting existing file versions on the document library.

## SYNTAX

```powershell
Get-PnPLibraryFileVersionBatchDeleteJobStatus -Identity <ListPipeBind> [-Connection <PnPConnection>]
```

## DESCRIPTION
This cmdlet allows retrieval of the progress of deleting existing file versions on the document library.

## EXAMPLES

### EXAMPLE 1
```powershell
Get-PnPLibraryFileVersionBatchDeleteJobStatus -Identity "Documents"
```

Returns the progress of deleting existing file versions on the document library.

## PARAMETERS

### -Identity
The ID, name or Url (Lists/MyList) of the document library to perform the trimming on.

```yaml
Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -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
```
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPLibraryFileVersionExpirationReportJobProgress.html
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPLibraryFileVersionExpirationReportJobStatus.html
external help file: PnP.PowerShell.dll-Help.xml
title: Get-PnPLibraryFileVersionExpirationReportJobProgress
title: Get-PnPLibraryFileVersionExpirationReportJobStatus
---

# Get-PnPLibraryFileVersionExpirationReportJobProgress
# Get-PnPLibraryFileVersionExpirationReportJobStatus

## SYNOPSIS

Expand All @@ -16,7 +16,7 @@ Gets the status for a file version usage report generation job for a document li
## SYNTAX

```powershell
Get-PnPLibraryFileVersionExpirationReportJobProgress -Identity <ListPipeBind> -ReportUrl <string>
Get-PnPLibraryFileVersionExpirationReportJobStatus -Identity <ListPipeBind> -ReportUrl <string>
```

## DESCRIPTION
Expand All @@ -27,7 +27,7 @@ Gets the status for a file version usage report generation job for a document li

### EXAMPLE 1
```powershell
Get-PnPLibraryFileVersionExpirationReportJobProgress -Identity "Documents" -ReportUrl "https://contoso.sharepoint.com/sites/reports/MyReports/VersionReport.csv"
Get-PnPLibraryFileVersionExpirationReportJobStatus -Identity "Documents" -ReportUrl "https://contoso.sharepoint.com/sites/reports/MyReports/VersionReport.csv"
```

Gets the status for a file version usage report generation job for a document library.
Expand Down
51 changes: 51 additions & 0 deletions documentation/Get-PnPSiteFileVersionBatchDeleteJobStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPSiteFileVersionBatchDeleteJobStatus.html
external help file: PnP.PowerShell.dll-Help.xml
title: Get-PnPSiteFileVersionBatchDeleteJobStatus
---

# Get-PnPSiteFileVersionBatchDeleteJobStatus

## SYNOPSIS
Get the progress of deleting existing file versions on the site.

## SYNTAX

```powershell
Get-PnPSiteFileVersionBatchDeleteJobStatus [-Connection <PnPConnection>]
```

## DESCRIPTION
This cmdlet allows retrieval of the progress of deleting existing file versions on the site.

## EXAMPLES

### EXAMPLE 1
```powershell
Get-PnPSiteFileVersionBatchDeleteJobStatus
```

Returns the progress of deleting existing file versions on the site.

## 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
```
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPSiteFileVersionExpirationReportJobProgress.html
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPSiteFileVersionExpirationReportJobStatus.html
external help file: PnP.PowerShell.dll-Help.xml
title: Get-PnPSiteFileVersionExpirationReportJobProgress
title: Get-PnPSiteFileVersionExpirationReportJobStatus
---

# Get-PnPSiteFileVersionExpirationReportJobProgress
# Get-PnPSiteFileVersionExpirationReportJobStatus

## SYNOPSIS

Expand All @@ -16,7 +16,7 @@ Gets the status for a file version usage report generation job for a site collec
## SYNTAX

```powershell
Get-PnPSiteFileVersionExpirationReportJobProgress -ReportUrl <string>
Get-PnPSiteFileVersionExpirationReportJobStatus -ReportUrl <string>
```

## DESCRIPTION
Expand All @@ -27,7 +27,7 @@ Gets the status for a file version usage report generation job for a site collec

### EXAMPLE 1
```powershell
Get-PnPSiteFileVersionExpirationReportJobProgress -ReportUrl "https://contoso.sharepoint.com/sites/reports/MyReports/VersionReport.csv"
Get-PnPSiteFileVersionExpirationReportJobStatus -ReportUrl "https://contoso.sharepoint.com/sites/reports/MyReports/VersionReport.csv"
```

Gets the status for a file version usage report generation job for a site collection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPSiteVersionPolicyProgress.html
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPSiteVersionPolicyStatus.html
external help file: PnP.PowerShell.dll-Help.xml
title: Get-PnPSiteVersionPolicyProgress
title: Get-PnPSiteVersionPolicyStatus
---

# Get-PnPSiteVersionPolicyProgress
# Get-PnPSiteVersionPolicyStatus

## SYNOPSIS
Get the progress of setting version policy for existing document libraries on the site.

## SYNTAX

```powershell
Get-PnPSiteVersionPolicyProgress [-Connection <PnPConnection>]
Get-PnPSiteVersionPolicyStatus [-Connection <PnPConnection>]
```

## DESCRIPTION
Expand All @@ -25,7 +25,7 @@ This cmdlet allows retrieval of the progress of setting version policy for exist

### EXAMPLE 1
```powershell
Get-PnPSiteVersionPolicyProgress
Get-PnPSiteVersionPolicyStatus
```

Returns the progress of setting version policy for existing document libraries on the site.
Expand Down
62 changes: 59 additions & 3 deletions documentation/New-PnPLibraryFileVersionBatchDeleteJob.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,28 @@ Starts a file version batch trim job for a document library.
New-PnPLibraryFileVersionBatchDeleteJob -Identity "Documents" -DeleteBeforeDays 360
```

Starts a file version batch trim job that will delete all file verions that are over 360 days old in the document library.
Starts a file version batch trim job that will delete all file versions that are over 360 days old in the document library.

### EXAMPLE 2
```powershell
New-PnPLibraryFileVersionBatchDeleteJob -Identity "Documents" -DeleteBeforeDays 360 -Force
```

Starts a file version batch trim job that will delete all file verions that are over 360 days old in the document library, without prompting the user for confirmation.
Starts a file version batch trim job that will delete all file versions that are over 360 days old in the document library, without prompting the user for confirmation.

### EXAMPLE 3
```powershell
New-PnPLibraryFileVersionBatchDeleteJob -Automatic
```

Starts a file version batch trim job that will delete file versions that expiread and set version expiration time for the ones not expired in the document library based on the backend algorithm.

### EXAMPLE 4
```powershell
New-PnPLibraryFileVersionBatchDeleteJob -MajorVersionLimit 30 -MajorWithMinorVersionsLimit 10
```

Starts a file version batch trim job that will delete file versions in the document library based on the version count limits.

## PARAMETERS

Expand All @@ -60,7 +74,7 @@ The minimum age of file versions to trim. In other words, all file versions that
```yaml
Type: int
Parameter Sets: (All)
Parameter Sets: DeleteOlderThanDays

Required: True
Position: Named
Expand All @@ -69,6 +83,48 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Automatic
Trim file version using automatic trim.
```yaml
Type: SwitchParameter
Parameter Sets: AutomaticTrim

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -MajorVersionLimit
Trim file version using version count limits. Need to specify MajorWithMinorVersionsLimit as well.
```yaml
Type: int
Parameter Sets: CountLimits

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -MajorWithMinorVersionsLimit
Trim file version using version count limits. Need to specify MajorVersionLimit as well.
```yaml
Type: int
Parameter Sets: CountLimits

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Force
When provided, no confirmation prompts will be shown to the user.
Expand Down
Loading

0 comments on commit ea27043

Please sign in to comment.