< Back

New-GcpsMessage

Mon Jan 13, 2020 11:30 pm

NAME New-GcpsMessage



SYNOPSIS

Creates a Google Cloud PubSub message.





SYNTAX

New-GcpsMessage [-Data <string>] [-Attributes <Hashtable>] [<CommonParameters>]





DESCRIPTION

Creates a Google Cloud PubSub message. The message created is intended to be used with Publish-GcpsMessage cmdlet

to publish it to a topic. The message payload must not be empty; it must contain either a non-empty data field or

at least one attribute. The cmdlet will base64-encode the message data.





PARAMETERS

-Data <string>

The message payload. This will be base64-encoded by the cmdlet.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Attributes <Hashtable>

Optional attributes for this message.



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



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



PS C:\\> New-GcpsMessage -Data "my-data"



This command creates a new message with data "my-data".

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



PS C:\\> New-GcpsMessage -Data "my-data" -Attributes @{"key"="value"}



This command creates a new message with data "my-data" and an attribute pair "key", "value".



RELATED LINKS

[PubSub Message] (https://cloud.google.com/pubsub/docs/re ... subMessage)