SCRT-HQ / PSGSuite

Powershell module for Google / G Suite API calls wrapped in handy functions. Authentication is established using a service account via P12 key to negate the consent popup and allow for greater handsoff automation capabilities
https://psgsuite.io/
Apache License 2.0
235 stars 67 forks source link

Functions for "Restore Data" #192

Closed IronKane2 closed 5 years ago

IronKane2 commented 5 years ago

I absolutely love PSGSuite! Now give me more :) I just now finished restoring data manually for 17 students. First place I went to was PSGSuite thinking I could knock this out in just a couple of minutes. I'm hoping you can add to the toolbox a Restore Data set of functions for Drive.

Thanks Nate!

scrthq commented 5 years ago

Hey @IronKane2 - Do you happen to have a link to the API page covering what you're trying to do? I know that data restoration can mean various things (Vault restoration, old version retrieval, etc), just want to make sure I understand what you're after and if it's something that is open via public API

scrthq commented 5 years ago

For example, I'm not seeing anything in the API docs for Admin SDK or Drive SDK that highlight data restoration in particular. The closest thing would be the Data Transfer API, but that's not exactly a restore. The only way to restore data from the Admin console is only doable from the console itself (as far as I'm aware), not via API: https://support.google.com/a/answer/6052340?hl=en

IronKane2 commented 5 years ago

Well damn. Thanks for the update. Hopefully Google will make an API for this sometime soon. What about this --> https://developers.google.com/drive/api/v2/reference/files/untrash Not applicable?

scrthq commented 5 years ago

So that exact method isn't doable (it's using the legacy v2 of the Drive API), but the equivalent method could be something to add to Update-GSDriveFile as a switch parameter: https://developers.google.com/drive/api/v3/reference/files/update

Example of the final product:

Update-GSDriveFile -FileId $fileId -Trashed:$false

Thoughts?

IronKane2 commented 5 years ago

Please don't waste any more time on this. It sounds like we'll have to wait for future API's from Google.
I'm using PSGSuite every day. Thank you so very much.

scrthq commented 5 years ago

I'll keep it backlogged for now, shouldn't be terribly difficult to implement =]. There's value there, for sure

scrthq commented 5 years ago

Hey @IronKane2 - This has been deployed in v2.28.0! Let me know if all is well or if you are seeing any issues!