Skip to content
Spencer Varney edited this page Dec 27, 2016 · 3 revisions

Get-GDriveFile

SYNOPSIS

Gets a file's metadata or content by ID.

SYNTAX

one (Default)

Get-GDriveFile [-FileId] <String> [[-AcknowledgeAbuse] <Boolean>] [-TargetUserEmail <String>]
 [-StandardQueryParams <StandardQueryParameters>] [-GAuthId <String>] [-WhatIf] [-Confirm]

list

Get-GDriveFile [-All] [[-Corpus] <CorpusEnum>] [[-OrderBy] <String>] [[-PageSize] <Int32>] [[-Q] <String>]
 [[-Spaces] <String>] [[-MaxResults] <Int32>] [-TargetUserEmail <String>]
 [-StandardQueryParams <StandardQueryParameters>] [-GAuthId <String>] [-WhatIf] [-Confirm]

DESCRIPTION

Gets a file's metadata or content by ID.

EXAMPLES

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

PS C:\> Get-GDriveFile -FileId $SomeFileIdString

This automatically generated example serves to show the bare minimum required to call this Cmdlet.

Additional examples may be added, viewed and edited by users on the community wiki at the URL found in the related links.

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

PS C:\> List-GDriveFile -All

This automatically generated example serves to show the bare minimum required to call this Cmdlet.

Additional examples may be added, viewed and edited by users on the community wiki at the URL found in the related links.

PARAMETERS

-FileId

The ID of the file.

Type: String
Parameter Sets: one
Aliases: 

Required: True
Position: 0
Default value: 
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-AcknowledgeAbuse

Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

Type: Boolean
Parameter Sets: one
Aliases: 

Required: False
Position: 1
Default value: 
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-All

A switch to list all results

Type: SwitchParameter
Parameter Sets: list
Aliases: 

Required: True
Position: 0
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Corpus

The source of files to list.

Possible values: Domain, User

Type: CorpusEnum
Parameter Sets: list
Aliases: 
Accepted values: Domain, User

Required: False
Position: 1
Default value: 
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-OrderBy

A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.

Type: String
Parameter Sets: list
Aliases: 

Required: False
Position: 2
Default value: 
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-PageSize

The maximum number of files to return per page.

Type: Int32
Parameter Sets: list
Aliases: 

Required: False
Position: 3
Default value: 
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Q

A query for filtering the file results. See the "Search for Files" guide for supported syntax.

Type: String
Parameter Sets: list
Aliases: 

Required: False
Position: 4
Default value: 
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Spaces

A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.

Type: String
Parameter Sets: list
Aliases: 

Required: False
Position: 5
Default value: 
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-MaxResults

Maximum number of results to return.

Type: Int32
Parameter Sets: list
Aliases: 

Required: False
Position: 6
Default value: 
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-TargetUserEmail

The email account to be targeted by the service account.

Type: String
Parameter Sets: (All)
Aliases: ServiceAccountTarget

Required: False
Position: Named
Default value: 
Accept pipeline input: False
Accept wildcard characters: False

-StandardQueryParams

A Standard Query Parameters Object.

Type: StandardQueryParameters
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: 
Accept pipeline input: False
Accept wildcard characters: False

-GAuthId

The GAuthId representing the gShell auth credentials this cmdlet should use to run.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: 
Accept pipeline input: False
Accept wildcard characters: False

INPUTS

System.String

The ID of the file.

System.Boolean

Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.

Google.Apis.Drive.v3.FilesResource+ListRequest+CorpusEnum

The source of files to list.

System.String

A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.

System.Int32

The maximum number of files to return per page.

System.String

A query for filtering the file results. See the "Search for Files" guide for supported syntax.

System.String

A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.

System.Int32

Maximum number of results to return.

OUTPUTS

NOTES

Part of the gShell Project, relating to the Google Drive API; see Related Links or use the -Online parameter.

RELATED LINKS

[Wiki page for this Cmdlet]

[Getting started with gShell]

Clone this wiki locally