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

New-GDriveFileObj

SYNOPSIS

Creates a new Drive API File object.

SYNTAX

New-GDriveFileObj [[-AppProperties] <System.Collections.Generic.IDictionary`2[System.String,System.String]>]
 [[-Capabilities] <CapabilitiesData>] [[-ContentHints] <ContentHintsData>] [[-CreatedTime] <DateTime>]
 [[-Description] <String>] [[-ExplicitlyTrashed] <Boolean>] [[-FileExtension] <String>]
 [[-FolderColorRgb] <String>] [[-FullFileExtension] <String>] [[-HeadRevisionId] <String>]
 [[-IconLink] <String>] [[-Id] <String>] [[-ImageMediaMetadata] <ImageMediaMetadataData>]
 [[-IsAppAuthorized] <Boolean>] [[-LastModifyingUser] <User>] [[-Md5Checksum] <String>] [[-MimeType] <String>]
 [[-ModifiedByMeTime] <DateTime>] [[-ModifiedTime] <DateTime>] [[-Name] <String>]
 [[-OriginalFilename] <String>] [[-OwnedByMe] <Boolean>] [[-Owners] <User[]>] [[-Parents] <String[]>]
 [[-Permissions] <Permission[]>]
 [[-Properties] <System.Collections.Generic.IDictionary`2[System.String,System.String]>]
 [[-QuotaBytesUsed] <Int64>] [[-Shared] <Boolean>] [[-SharedWithMeTime] <DateTime>] [[-SharingUser] <User>]
 [[-Size] <Int64>] [[-Spaces] <String[]>] [[-Starred] <Boolean>] [[-ThumbnailLink] <String>]
 [[-Trashed] <Boolean>] [[-Version] <Int64>] [[-VideoMediaMetadata] <VideoMediaMetadataData>]
 [[-ViewedByMe] <Boolean>] [[-ViewedByMeTime] <DateTime>] [[-ViewersCanCopyContent] <Boolean>]
 [[-WebContentLink] <String>] [[-WebViewLink] <String>] [[-WritersCanShare] <Boolean>] [-WhatIf] [-Confirm]

DESCRIPTION

This provides a Cmdlet-Based approach to creating a File object which may be required as a parameter for some other Cmdlets in the Drive API category.

You could alternately create this object by calling New-Object -TypeName Google.Apis.Drive.v3.Data.File

EXAMPLES

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

PS C:\> New-GDriveFileObj

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

-AppProperties

A collection of arbitrary key-value pairs which are private to the requesting app.Entries with null values are cleared in update and copy requests.

Type: System.Collections.Generic.IDictionary`2[System.String,System.String]
Parameter Sets: (All)
Aliases: 

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

-Capabilities

Capabilities the current user has on the file.

Type: CapabilitiesData
Parameter Sets: (All)
Aliases: 

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

-ContentHints

Additional information about the content of the file. These fields are never populated in responses.

Type: ContentHintsData
Parameter Sets: (All)
Aliases: 

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

-CreatedTime

The time at which the file was created (RFC 3339 date-time).

Type: DateTime
Parameter Sets: (All)
Aliases: 

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

-Description

A short description of the file.

Type: String
Parameter Sets: (All)
Aliases: 

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

-ExplicitlyTrashed

Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

-FileExtension

The final component of fullFileExtension. This is only available for files with binary content in Drive.

Type: String
Parameter Sets: (All)
Aliases: 

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

-FolderColorRgb

The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.If an unsupported color is specified, the closest color in the palette will be used instead.

Type: String
Parameter Sets: (All)
Aliases: 

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

-FullFileExtension

The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.

Type: String
Parameter Sets: (All)
Aliases: 

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

-HeadRevisionId

The ID of the file's head revision. This is currently only available for files with binary content in Drive.

Type: String
Parameter Sets: (All)
Aliases: 

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

-IconLink

A static, unauthenticated link to the file's icon.

Type: String
Parameter Sets: (All)
Aliases: 

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

-Id

The ID of the file.

Type: String
Parameter Sets: (All)
Aliases: 

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

-ImageMediaMetadata

Additional metadata about image media, if available.

Type: ImageMediaMetadataData
Parameter Sets: (All)
Aliases: 

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

-IsAppAuthorized

Whether the file was created or opened by the requesting app.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

-LastModifyingUser

The last user to modify the file.

Type: User
Parameter Sets: (All)
Aliases: 

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

-Md5Checksum

The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.

Type: String
Parameter Sets: (All)
Aliases: 

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

-MimeType

The MIME type of the file.Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.

Type: String
Parameter Sets: (All)
Aliases: 

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

-ModifiedByMeTime

The last time the file was modified by the user (RFC 3339 date-time).

Type: DateTime
Parameter Sets: (All)
Aliases: 

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

-ModifiedTime

The last time the file was modified by anyone (RFC 3339 date-time).Note that setting modifiedTime will also update modifiedByMeTime for the user.

Type: DateTime
Parameter Sets: (All)
Aliases: 

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

-Name

The name of the file. This is not necessarily unique within a folder.

Type: String
Parameter Sets: (All)
Aliases: 

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

-OriginalFilename

The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.

Type: String
Parameter Sets: (All)
Aliases: 

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

-OwnedByMe

Whether the user owns the file.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

-Owners

The owners of the file. Currently, only certain legacy files may have more than one owner.

Type: User[]
Parameter Sets: (All)
Aliases: 

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

-Parents

The IDs of the parent folders which contain the file.If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.

Type: String[]
Parameter Sets: (All)
Aliases: 

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

-Permissions

The full list of permissions for the file. This is only available if the requesting user can share the file.

Type: Permission[]
Parameter Sets: (All)
Aliases: 

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

-Properties

A collection of arbitrary key-value pairs which are visible to all apps.Entries with null values are cleared in update and copy requests.

Type: System.Collections.Generic.IDictionary`2[System.String,System.String]
Parameter Sets: (All)
Aliases: 

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

-QuotaBytesUsed

The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.

Type: Int64
Parameter Sets: (All)
Aliases: 

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

-Shared

Whether the file has been shared.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

-SharedWithMeTime

The time at which the file was shared with the user, if applicable (RFC 3339 date-time).

Type: DateTime
Parameter Sets: (All)
Aliases: 

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

-SharingUser

The user who shared the file with the requesting user, if applicable.

Type: User
Parameter Sets: (All)
Aliases: 

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

-Size

The size of the file's content in bytes. This is only applicable to files with binary content in Drive.

Type: Int64
Parameter Sets: (All)
Aliases: 

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

-Spaces

The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.

Type: String[]
Parameter Sets: (All)
Aliases: 

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

-Starred

Whether the user has starred the file.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

-ThumbnailLink

A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.

Type: String
Parameter Sets: (All)
Aliases: 

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

-Trashed

Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

-Version

A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the user.

Type: Int64
Parameter Sets: (All)
Aliases: 

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

-VideoMediaMetadata

Additional metadata about video media. This may not be available immediately upon upload.

Type: VideoMediaMetadataData
Parameter Sets: (All)
Aliases: 

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

-ViewedByMe

Whether the file has been viewed by this user.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

-ViewedByMeTime

The last time the file was viewed by the user (RFC 3339 date-time).

Type: DateTime
Parameter Sets: (All)
Aliases: 

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

-ViewersCanCopyContent

Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

-WebContentLink

A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.

Type: String
Parameter Sets: (All)
Aliases: 

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

-WebViewLink

A link for opening the file in a relevant Google editor or viewer in a browser.

Type: String
Parameter Sets: (All)
Aliases: 

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

-WritersCanShare

Whether users with only writer permission can modify the file's permissions.

Type: Boolean
Parameter Sets: (All)
Aliases: 

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

INPUTS

A collection of arbitrary key-value pairs which are private to the requesting app.Entries with null values are cleared in update and copy requests.

Google.Apis.Drive.v3.Data.File+CapabilitiesData

Capabilities the current user has on the file.

Google.Apis.Drive.v3.Data.File+ContentHintsData

Additional information about the content of the file. These fields are never populated in responses.

System.DateTime

The time at which the file was created (RFC 3339 date-time).

System.String

A short description of the file.

System.Boolean

Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.

System.String

The final component of fullFileExtension. This is only available for files with binary content in Drive.

System.String

The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.If an unsupported color is specified, the closest color in the palette will be used instead.

System.String

The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.

System.String

The ID of the file's head revision. This is currently only available for files with binary content in Drive.

System.String

A static, unauthenticated link to the file's icon.

System.String

The ID of the file.

Google.Apis.Drive.v3.Data.File+ImageMediaMetadataData

Additional metadata about image media, if available.

System.Boolean

Whether the file was created or opened by the requesting app.

Google.Apis.Drive.v3.Data.User

The last user to modify the file.

System.String

The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.

System.String

The MIME type of the file.Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.

System.DateTime

The last time the file was modified by the user (RFC 3339 date-time).

System.DateTime

The last time the file was modified by anyone (RFC 3339 date-time).Note that setting modifiedTime will also update modifiedByMeTime for the user.

System.String

The name of the file. This is not necessarily unique within a folder.

System.String

The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.

System.Boolean

Whether the user owns the file.

Google.Apis.Drive.v3.Data.User[]

The owners of the file. Currently, only certain legacy files may have more than one owner.

System.String[]

The IDs of the parent folders which contain the file.If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.

Google.Apis.Drive.v3.Data.Permission[]

The full list of permissions for the file. This is only available if the requesting user can share the file.

A collection of arbitrary key-value pairs which are visible to all apps.Entries with null values are cleared in update and copy requests.

System.Int64

The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.

System.Boolean

Whether the file has been shared.

System.DateTime

The time at which the file was shared with the user, if applicable (RFC 3339 date-time).

Google.Apis.Drive.v3.Data.User

The user who shared the file with the requesting user, if applicable.

System.Int64

The size of the file's content in bytes. This is only applicable to files with binary content in Drive.

System.String[]

The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.

System.Boolean

Whether the user has starred the file.

System.String

A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.

System.Boolean

Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.

System.Int64

A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the user.

Google.Apis.Drive.v3.Data.File+VideoMediaMetadataData

Additional metadata about video media. This may not be available immediately upon upload.

System.Boolean

Whether the file has been viewed by this user.

System.DateTime

The last time the file was viewed by the user (RFC 3339 date-time).

System.Boolean

Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.

System.String

A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.

System.String

A link for opening the file in a relevant Google editor or viewer in a browser.

System.Boolean

Whether users with only writer permission can modify the file's permissions.

OUTPUTS

Google.Apis.Drive.v3.Data.File

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