GMGoogleDrive icon indicating copy to clipboard operation
GMGoogleDrive copied to clipboard

Issue with Authorization Code

Open mcc85s opened this issue 5 years ago • 7 comments

Select-Object : Property "forms" cannot be found. At C:\Development Tools\GMGoogleDrive\GMGoogleDrive\Public\Request-GDriveAuthorizationCode.ps1:106 char:37

  • ... $forms = $ie.Document | Select-Object -ExpandProperty forms
  •                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (System.__ComObject:PSObject) [Select-Object], PSArgumentException
    • FullyQualifiedErrorId : ExpandPropertyNotFound,Microsoft.PowerShell.Commands.SelectObjectCommand

Request-GDriveAuthorizationCode : You cannot call a method on a null-valued expression. At line:1 char:12

  • $code = Request-GDriveAuthorizationCode -ClientID $oauth_json.web. ...
  •        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Request-GDriveAuthorizationCode

I scoped out the module you wrote for this, is there a way to automate this for public access ? or is this strictly meant for manual use? I like the idea, it just seems a little short on automation details... Given all the hard work you apparently put into this... seems like it should be possible to automate

mcc85s avatar Jul 30 '19 01:07 mcc85s

I tried to upload some files with gci -path ... -recurse

didn't like that very much lol

mcc85s avatar Jul 30 '19 01:07 mcc85s

Since google update it's authorization form cmdlet Request-GDriveAuthorizationCode seems doesn't work in unattended mode

MVKozlov avatar Jul 30 '19 19:07 MVKozlov

I tried to upload some files with gci -path ... -recurse

what do you mean ? Add-GDriveItem does not support pipeline for now

MVKozlov avatar Jul 30 '19 19:07 MVKozlov

I mean it actually uploaded most of my files that way, but I think it has the same general error that 7z has when you try to pipeline a folder structure, if the folders are duplicated ( since multiple files in a folder would mean that... ) then it just errors out.

It did manage to upload everything minus the correct paths, just a lot of errors lol. I think if anything it might just need a verification property or progress indicator in order to pipeline with it. I don't know that though.

I'd be more than happy to help you out if you're doing this on your own, there's quite a lot of code to sift through though, I might have some ideas on how to help.

mcc85s avatar Jul 31 '19 02:07 mcc85s

I move pipeline discussion to another topic for consistence (#7)

...And about authorization. The idea of Request-GDriveAuthorizationCode was to automate getting the code, but this procedure should stay manually controlled and not used in any fully automated scripts

I can not understand why your attempt to use it failed. When I try to run it, everything stops at the last stage, where I have to allow access, but not before. Perhaps Google shows forms differently for different locations

MVKozlov avatar Jul 31 '19 05:07 MVKozlov

Hi Sir @MVKozlov , can u please guide me how to import your module into my script. it is very useful for me.

haranadh2501 avatar May 10 '20 18:05 haranadh2501

@haranadh2501 did you read the instructions in readme? what exactly remained incomprehensible?

MVKozlov avatar May 11 '20 10:05 MVKozlov