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

[System.IO.FileShare] does not contain a method named 'op_Addition' #178

Closed lefoimpeur closed 5 years ago

lefoimpeur commented 5 years ago

I have another similar issue with "Start-GSDriveFileUpload" : Start-GSDriveFileUpload : Method invocation failed because [System.IO.FileShare] does not contain a method named 'op_Addition'

scrthq commented 5 years ago

Thanks for letting me know, @lefoimpeur ! Couple questions so I can dig in a little better:

lefoimpeur commented 5 years ago
scrthq commented 5 years ago

Thank you for the additional details, @lefoimpeur !! Should have a fix for you by tomorrow night once I have some time =]

lefoimpeur commented 5 years ago

Hi @scrthq, Did you have time to work on the fix ?

scrthq commented 5 years ago

hey @lefoimpeur - I have the fix for this sorted =], just working on getting a couple other pending fixes/features included that have been delaying this overall. Should hopefully have a new version published tonight with this fix, I'll definitely let you know though!

For reference, the issue is that PS4 doesn't handle adding the enum values for [System.IO.FileShare]. You can replicate the error with the following line, fixed line right after for comparison (validated fix in my PS2.0 VM):

# Current code (works fine in PS5+)
[System.IO.FileShare]::Delete + [System.IO.FileShare]::ReadWrite

# Updating to the following (works in PS2.0+)
[System.IO.FileShare]"Delete, ReadWrite"
scrthq commented 5 years ago

Hey @lefoimpeur - v2.26.2 is out now with this fix. Please try it out and let me know if you're still having any issues! Thanks for your patience!

lefoimpeur commented 5 years ago

Hi @scrthq , really good, It works ! Thank you