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

Get-GGmailMessage

SYNOPSIS

Gets the specified message.

SYNTAX

one (Default)

Get-GGmailMessage [-UserId] <String> [-Id] <String> [[-Format] <FormatEnum>] [[-MetadataHeaders] <String[]>]
 [-TargetUserEmail <String>] [-StandardQueryParams <StandardQueryParameters>] [-GAuthId <String>] [-WhatIf]
 [-Confirm]

list

Get-GGmailMessage [-UserId] <String> [-All] [[-IncludeSpamTrash] <Boolean>] [[-LabelIds] <String[]>]
 [[-MaxResults] <Int32>] [[-Query] <String>] [-TargetUserEmail <String>]
 [-StandardQueryParams <StandardQueryParameters>] [-GAuthId <String>] [-WhatIf] [-Confirm]

DESCRIPTION

Gets the specified message.

EXAMPLES

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

PS C:\> Get-GGmailMessage -UserId $SomeUserIdString -Id $SomeIdString

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:\> Get-GGmailMessage -UserId $SomeUserIdString -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

-UserId

The user's email address. The special value me can be used to indicate the authenticated user.

Type: String
Parameter Sets: (All)
Aliases: 

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

-Id

The ID of the message to retrieve.

Type: String
Parameter Sets: one
Aliases: 

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

-Format

The format to return the message in.

Possible values: Full, Metadata, Minimal, Raw

Type: FormatEnum
Parameter Sets: one
Aliases: 
Accepted values: Full, Metadata, Minimal, Raw

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

-MetadataHeaders

When given and format is METADATA, only include headers specified.

Type: String[]
Parameter Sets: one
Aliases: 

Required: False
Position: 3
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: 1
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-IncludeSpamTrash

Include messages from SPAM and TRASH in the results.

Type: Boolean
Parameter Sets: list
Aliases: 

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

-LabelIds

Only return messages with labels that match all of the specified label IDs.

Type: String[]
Parameter Sets: list
Aliases: 

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

-MaxResults

Maximum number of messages to return.

Type: Int32
Parameter Sets: list
Aliases: 

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

-Query

Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread".

Type: String
Parameter Sets: list
Aliases: 

Required: False
Position: 5
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 user's email address. The special value me can be used to indicate the authenticated user.

System.String

The ID of the message to retrieve.

Google.Apis.Gmail.v1.UsersResource+MessagesResource+GetRequest+FormatEnum

The format to return the message in.

System.String[]

When given and format is METADATA, only include headers specified.

System.Boolean

Include messages from SPAM and TRASH in the results.

System.String[]

Only return messages with labels that match all of the specified label IDs.

System.Int32

Maximum number of messages to return.

System.String

Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread".

OUTPUTS

NOTES

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

RELATED LINKS

[Wiki page for this Cmdlet]

[Getting started with gShell]

Clone this wiki locally