Skip to content
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

[FileVersion] Add and update batch delete cmdlets #3828

Merged
merged 7 commits into from
Apr 8, 2024

Conversation

msjennywu
Copy link
Contributor

@msjennywu msjennywu commented Mar 13, 2024

Before creating a pull request, make sure that you have read the contribution file located at

https://github.com/pnp/powerShell/blob/dev/CONTRIBUTING.md

Type

  • Bug Fix
  • New Feature
  • Sample

What is in this Pull Request ?

  1. Updated existing commands "New-PnPSiteFileVersionBatchDeleteJob" and "New-PnPLibraryFileVersionBatchDeleteJob" with new batch delete mode
  2. Added new commands for getting progress "Get-PnPSiteFileVersionBatchDeleteJobProgress" and "Get-PnPLibraryFileVersionBatchDeleteJobProgress"
  3. Added or updated related documentations

Test scenarios

  1. Create DeleteOlderThanDays workitem on site
    New-PnPSiteFileVersionBatchDeleteJob -DeleteBeforeDays 40
    Get-PnPSiteFileVersionBatchDeleteJobProgress

  2. Create CountLimits workitem on site
    New-PnPSiteFileVersionBatchDeleteJob -MajorVersionLimit 10 -MajorWithMinorVersionsLimit 10
    Get-PnPSiteFileVersionBatchDeleteJobProgress

  3. Create AutomaticTrim workitem on site
    New-PnPSiteFileVersionBatchDeleteJob -Automatic
    Get-PnPSiteFileVersionBatchDeleteJobProgress

  4. Remove workitem on site
    Remove-PnPSiteFileVersionBatchDeleteJob
    Get-PnPSiteFileVersionBatchDeleteJobProgress

  5. Create DeleteOlderThanDays workitem on library
    New-PnPLibraryFileVersionBatchDeleteJob -Identity "jsite1lib1" -DeleteBeforeDays 200
    Get-PnPLibraryFileVersionBatchDeleteJobProgress -Identity "jsite1lib1"

  6. Create CountLimits workitem on library
    New-PnPLibraryFileVersionBatchDeleteJob -Identity "jsite1lib1" -MajorVersionLimit 10 -MajorWithMinorVersionsLimit 10
    Get-PnPLibraryFileVersionBatchDeleteJobProgress -Identity "jsite1lib1"

  7. Create AutomaticTrim workitem on library
    New-PnPLibraryFileVersionBatchDeleteJob -Identity "jsite1lib1" -Automatic
    Get-PnPLibraryFileVersionBatchDeleteJobProgress -Identity "jsite1lib1"

  8. Remove workitem on library
    Remove-PnPLibraryFileVersionBatchDeleteJob -Identity "jsite1lib1"
    Get-PnPLibraryFileVersionBatchDeleteJobProgress -Identity "jsite1lib1"

Test results

  1. Site commands
image image image image
  1. Library commands
image image image image

@gautamdsheth
Copy link
Collaborator

Hi @KoenZomers , @msjennywu - the cmdlet names are too long. We need to trim it.
How about New-PnPFileVersionBatchDeleteJob , a single cmdlet which does the job for both site and document library. We separate them by Parameter sets ? Same goes for other cmdlets as well which work on this.

New-PnPFileVersionBatchDeleteJob, Get-PnPFileVersionBatchDeleteStatus, Remove-PnPFileVersionBatchDeleteJob etc. is what I am proposing. The existing names don't make sense to me and will also confuse users as well I think. In the new names that I propose, we add additional parameters like -Site or -List or -Library .

Thoughts ?

@KoenZomers
Copy link
Collaborator

Cmdlets renamed as discussed through Teams. Ready to merge.

@KoenZomers KoenZomers merged commit ea27043 into pnp:dev Apr 8, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants