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

Extended Restore-PnPRecycleBinItem functionality to efficiently restore selected set of items in bulk #4705

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from

Conversation

namwar
Copy link

@namwar namwar commented Jan 26, 2025

Type

  • Bug Fix
  • [X ] New Feature
  • Sample

What is in this Pull Request ?

Extended the functionality of Restore-PnPRecycleBinItem cmdlet by adding another parameter set. The new parameter set allows the user to provide a string array of Recycle Bin item IDs. It will enable users to deal with scenarios where many (but not all) items need to be restored.
The caller can provide a list of IDs of items to bulk restore them. Bulk restore in this case will use REST API to restore items efficiently, in bulk. It also uses a fallback logic to deal with batch errors and automatically switches to individual restore, if needed.

…ing another parameterset for providing an array of Ids of items to restore in bulk. This will allow the users to deal with the scenarios where a lot (but not all) of files need to be restored. Caller can provide a list of Ids of items to bulk restore them. Bulk restore in this case will use REST API to restore items quickly. It also uses a fall back logic to deal with batch errors and automatically switches to individual restore, if needed.
@namwar namwar changed the title Extended Restore-PnPRecycleBinItem functionality to restore selected set of items in bulk efficiently Extended Restore-PnPRecycleBinItem functionality to efficiently restore selected set of items in bulk Jan 26, 2025
@KoenZomers
Copy link
Collaborator

Thanks @namwar for your efforts! Looks cool! Left two comments for you. Would appreciate it if you could have a look at those.

…k to log reasons for failure to restore an item, in case of an error.
@namwar
Copy link
Author

namwar commented Jan 30, 2025

Please have a look at my comments on your feedback. I have clarified your concern. I think you can merge my code.

@KoenZomers
Copy link
Collaborator

Looks good @namwar, thanks!

@KoenZomers
Copy link
Collaborator

KoenZomers commented Jan 30, 2025

Still missing your change in the documentation by the way. Can you update Get-PnPRecycleBinItem.md to reflect this new option?

@KoenZomers
Copy link
Collaborator

You also don't seem to have checked the option to allow us to update your PR branch so I can add the changelog entry to it. Can you enable that please?

@namwar
Copy link
Author

namwar commented Jan 30, 2025

Thanks for your reply. I have checked and it is already checked for "Allow edits by maintainers". Am I missing something? Please guide me

image

@namwar
Copy link
Author

namwar commented Jan 30, 2025

I will update the Get-PnPRecycleBinItem.md quickly

Added information about the new parameter set.  Added example and parameter information.
@namwar
Copy link
Author

namwar commented Jan 30, 2025

I have updated the documentation/Restore-PnPRecycleBinItem.md. Please have a look.

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.

2 participants