< Back

Copy-GDriveItem

Mon Jan 13, 2020 10:22 pm

NAME Copy-GDriveItem



SYNOPSIS

Copy existing GoogleDrive Item into new Item





SYNTAX

Copy-GDriveItem [-ID] <String> -AccessToken <String> [-WhatIf] [-Confirm] [<CommonParameters>]



Copy-GDriveItem [-ID] <String> [-Name] <String> [[-ParentID] <String[]>] -AccessToken <String> [-WhatIf]

[-Confirm] [<CommonParameters>]



Copy-GDriveItem [-ID] <String> [-JsonProperty <String>] -AccessToken <String> [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

Copy existing GoogleDrive Item into new Item

By default item copied into same folder as original





PARAMETERS

-ID <String>

File ID to copy



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <String>

Name of an item to be created



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ParentID <String[]>

Folder ID(s) in which new item will be placed



Required? false

Position? 3

Default value @()

Accept pipeline input? false

Accept wildcard characters? false



-JsonProperty <String>

Json-formatted string with all needed file metadata



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AccessToken <String>

Access Token for request



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Json with item metadata as PSObject





NOTES





Author: Max Kozlov



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>#Name based copy



Copy-GDriveItem -AccessToken $access_token -ID '0BAjkl4cBDNVpVbB5nGhKQ195aU0' -Name SomeDocument.doc -ParentID

'root'









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>#Metadata based copy



Copy-GDriveItem -AccessToken $access_token -ID '0BAjkl4cBDNVpVbB5nGhKQ195aU0' -JsonProperty '{ "name":"test1" }'











RELATED LINKS

Set-GDriveItemProperty

Move-GDriveItem

Rename-GDriveItem

https://developers.google.com/drive/api ... files/copy