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

Support to delete file version history #1375

Closed
matsla opened this issue Feb 2, 2024 · 3 comments
Closed

Support to delete file version history #1375

matsla opened this issue Feb 2, 2024 · 3 comments
Assignees
Labels
area: model 📐 Related to the core SDK models help wanted Extra attention is needed

Comments

@matsla
Copy link

matsla commented Feb 2, 2024

It seems to be supported to delete versions on a listitem but not a file.

We are currently implementing an archive solution and one of the steps is to remove file version history, when will this be supported?

PNP PowerShell you can remove a single file versions and all versions for a file

@jansenbe
Copy link
Contributor

@matsla : in the interest of time, can you check in PnP PS what API calls are used for this

@jansenbe jansenbe added help wanted Extra attention is needed area: model 📐 Related to the core SDK models labels Feb 12, 2024
@matsla
Copy link
Author

matsla commented Feb 16, 2024

@jansenbe : PnP PS use CSOM assemblies Microsoft.SharePoint.Client.File object to load all versions and then delete

https://github.com/pnp/powershell/blob/dev/src/Commands/Files/RemoveFileVersion.cs

jansenbe added a commit that referenced this issue Feb 16, 2024
…ycleByLabel` and `RestoreByLabel` methods for `IFileVersionCollection` #1375
@jansenbe
Copy link
Contributor

@matsla : Just added DeleteAll, DeleteByID, DeleteByLabel, RecycleByID, RecycleByLabel and RestoreByLabel methods for IFileVersionCollection. These will be part of the nect nightly, closing this issue now.

@jansenbe jansenbe self-assigned this Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: model 📐 Related to the core SDK models help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants