-
Notifications
You must be signed in to change notification settings - Fork 67
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
Start-gsdrivefileupload recurse function doesn't place the files in the correct parent directory #235
Comments
👀 checking this out, thanks @TheEZ12c ! Just to confirm, you're not passing a value to the |
I do put in the parent Id for the folder I would like everything placed
under.
…On Wed, Sep 25, 2019, 11:08 AM Nate Ferrell ***@***.***> wrote:
👀 checking this out, thanks @TheEZ12c <https://github.com/TheEZ12c> !
Just to confirm, you're not passing a value to the Parents parameter on
Start-GSDriveFileUpload, right?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#235>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANJXK3VUK26FGSN6KQLGYZ3QLOEHZANCNFSM4I2OJSBA>
.
|
alright, seeing if I can replicate and will let you know! If you have a sample of the full command you're running with anything sensitive redacted, that would be helpful! |
Sure thing! I was just testing it out and using it pretty straight forward.
Start-GSDriveFileUpload -path $MyPath -Name $File.name -Parents $Parent
-user $User -recurse -wait
Just doing that one liner was causing the issue to crop up
…On Wed, Sep 25, 2019 at 3:02 PM Nate Ferrell ***@***.***> wrote:
alright, seeing if I can replicate and will let you know! If you have a
sample of the full command you're running with anything sensitive redacted,
that would be helpful!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#235>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANJXK3V74X6OTHWVXH2D5VDQLO7VVANCNFSM4I2OJSBA>
.
|
Hey @TheEZ12c - The only way I'm able to replicate this is if I pass a bad ParentId to the How are you pulling the parent ID of the folder that you're trying to upload to? The easiest way to get the folder ID of the parent folder is to open the folder in Drive, then grab the ID from the URL. Your URL should look something like this with the bold section highlighting the folder ID you would want to pass to the Parents parameter: https://drive.google.com/drive/u/0/folders/ 1CyslrEPaPt3YPehPUFFNRmQOrPzrSQ_7 Your call to upload a recursive folder structure should look something like this: Start-GSDriveFileUpload -Path .\PSGSuite\Public -Parents '1CyslrEPaPt3YPehPUFFNRmQOrPzrSQ_7' -Recurse -Wait -Verbose If you enable Also FYI - I need to remove the |
## 2.33.1 - 2019-10-06 * [Issue #235](#235) * Removed: `Name` parameter from `Start-GSDriveFileUpload` as it was unused in the function and doesnt make sense when uploading an array of files. * [Issue #238](#238) * Added: `Get-GSDataTransfer` to Get/List current Data Transfers * [Issue #239](#239) * Removed: `Update-GSResource` `Id` parameter as it was non-applicable (duplicate of `ResourceId` and not writable per API docs) * Cleaned up function help and examples to match changes * [Issue #240](#240) * Fixed: `Get-GSCalendar` now properly resolves single calendar metadata retrieval and passes List requests to `Get-GSCalendarSubscription` since the `Calendars` service does not support List requests. * Miscellaneous * Updated Google .NET SDKs to latest versions * Cleaned up build.ps1 script
## 2.33.1 - 2019-10-06 * [Issue #235](#235) * Removed: `Name` parameter from `Start-GSDriveFileUpload` as it was unused in the function and doesnt make sense when uploading an array of files. * [Issue #238](#238) * Added: `Get-GSDataTransfer` to Get/List current Data Transfers * [Issue #239](#239) * Removed: `Update-GSResource` `Id` parameter as it was non-applicable (duplicate of `ResourceId` and not writable per API docs) * Cleaned up function help and examples to match changes * [Issue #240](#240) * Fixed: `Get-GSCalendar` now properly resolves single calendar metadata retrieval and passes List requests to `Get-GSCalendarSubscription` since the `Calendars` service does not support List requests. * Miscellaneous * Updated Google .NET SDKs to latest versions * Cleaned up build.ps1 script
Hey Nate, thinks for taking a look! It is a folder in a shared drive and I
am getting the ID by get-gsdrivefilelist | where {$_.name -like "blah"}.
Weird thing is is that it makes the folder structure in the correct spot,
just doesnt put the files there.
…On Sun, Oct 6, 2019, 3:15 AM Nate Ferrell ***@***.***> wrote:
Hey @TheEZ12c <https://github.com/TheEZ12c> - The only way I'm able to
replicate this is if I pass a bad ParentId to the Parents parameter, at
which point all of the subfolders are created directly under the root of
the Drive.
How are you pulling the parent ID of the folder that you're trying to
upload to?
The easiest way to get the folder ID of the parent folder is to open the
folder in Drive, then grab the ID from the URL. Your URL should look
something like this with the *bold* section highlighting the folder ID
you would want to pass to the Parents parameter:
https://drive.google.com/drive/u/0/folders/
*1CyslrEPaPt3YPehPUFFNRmQOrPzrSQ_7*
Your call to upload a recursive folder structure should look something
like this:
Start-GSDriveFileUpload -Path .\PSGSuite\Public -Parents '1CyslrEPaPt3YPehPUFFNRmQOrPzrSQ_7' -Recurse -Wait -Verbose
If you enable Verbose, you should see something like the following:
[image: image]
<https://user-images.githubusercontent.com/12724445/66266193-3722cd00-e7e7-11e9-9e97-4117657e416c.png>
------------------------------
Also FYI - I need to remove the Name parameter from the function as it
currently doesn't do anything after reviewing the code and wouldn't make
sense anyway when uploading a recursive folder/file structure, tbh.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#235>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANJXK3SCSNNJ3YO2SIC3IPLQNGNCPANCNFSM4I2OJSBA>
.
|
Gotcha! That Shared Drive bit definitely helps! Let me test and see if I can replicate, could absolutely be a Shared Drive issue since the underlying Request objects for Drive SDK need to be flagged as supporting Shared Drives specifically. Digging in once more! |
Just to confirm @TheEZ12c - Do the files get uploaded to a Shared Drive folder, just not in the correct, new folder structure? or do the folders get created in the Shared Drive, but the files are uploaded to the root of My Drive? |
Huh, that's weird. For the shared drive it was creating the structure but
putting the files in the root of the shared drive.
Which version are you testing with? I will also test again this morning
when I get in the office.
…On Sun, Oct 6, 2019, 11:51 PM Nate Ferrell ***@***.***> wrote:
Tried a subfolder in a Shared Drive as well, still working fine for me :-(
[image: image]
<https://user-images.githubusercontent.com/12724445/66285839-3300b900-e894-11e9-9567-267a1b1d09db.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#235>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANJXK3W7AUBRJT36W627VI3QNK543ANCNFSM4I2OJSBA>
.
|
Testing with the latest version (2.33.2), but there hasn't been any code changes to the logic that determines where to upload a file to in a while. If you run with |
Okay, so just uploaded to the shared drive and it worked... The only other
difference that I can think is that some of the files that I was attempting
to upload were from a network share. I didn't look through too terribly
closely at the code to see if that might affect it. Would that be it?
For example, it would be like "start-gsdrivefileupload -path
\\server\share\folderinshare -parent TeamDriveID -recurse"
…On Mon, Oct 7, 2019 at 11:33 AM Nate Ferrell ***@***.***> wrote:
Testing with the latest version (2.33.2), but there hasn't been any code
changes to the logic that determines where to upload a file to in a while.
If you run with Verbose, that might illuminate some issues potentially.
I'm assuming you're not seeing any errors either at any point?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#235>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANJXK3T5QLPNXZOSDP3N3PDQNNQEZANCNFSM4I2OJSBA>
.
|
hmmm I don't think it would, since it's only looking at the source folder itself, not the full path to it, when pulling that info... it may break it though... I can try and replicate from my end as well |
hey @TheEZ12c - still haven't had a chance to test this further with a UNC path, I'll let you know once I'm able to though! |
Describe the bug
When using the start-psdrivefileupload function with the recurse switch, it will create the folder structure of the directory to be uploaded, but then it places all of the files in the root directory.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
In the documentation it states that it should place the files in the same directory pattern in Google as the original directory
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: