New-MsmqMessage

Creates a message object.

Syntax

New-MsmqMessage
   [[-Body] <Object>]
   [-Recoverable]
   [-Authenticated]
   [-Journaling]
   [-Label <String>]
   [-AdminQueuePath <String>]
   [-AcknowledgeType <AcknowledgeTypes>]
   [-ResponseQueuePath <String>]
   [-TimeToReachQueue <TimeSpan>]
   [-TimeToBeReceived <TimeSpan>]
   [<CommonParameters>]

Description

The New-MsmqMessage cmdlet creates a System.Messaging.Message object that includes properties specified by parameters.

Examples

Example 1: Create a test message

PS C:\> New-MsmqMessage -Body "Test Message" -AdminQueuePath ".\private$\adminqueue" -Recoverable

This command creates a test message. The command specifies the queue that receives the acknowledgement message.

Parameters

-AcknowledgeType

Specifies the type of acknowledgement messages that can be returned by Messaging Queuing.

Type:AcknowledgeTypes
Accepted values:None, PositiveArrival, PositiveReceive, NotAcknowledgeReachQueue, FullReachQueue, NegativeReceive, NotAcknowledgeReceive, FullReceive
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AdminQueuePath

Specifies a path. The queue that the path specifies receives the acknowledgement messages that Message Queuing generates.

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

-Authenticated

Indicates that the cmdlet sends the message as an authenticated message.

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

-Body

Specifies the body of the message. The default value is an empty body.

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

-Journaling

Indicates that the originating computer keeps a copy of the message in a journal.

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

-Label

Specifies a label. The label that this parameter specifies describes the message. The default value is an empty string.

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

-Recoverable

Indicates that the cmdlet sets the recoverable property of a message object.

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

-ResponseQueuePath

Specifies a path. The queue that this parameter specifies receives application-generated response messages.

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

-TimeToBeReceived

Specifies the maximum amount of time, in milliseconds, for the message to be received from the destination queue. The default value is 49.17:02:47.295.

Type:TimeSpan
Aliases:TTBR
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TimeToReachQueue

Specifies the maximum amount of time, in milliseconds, for the message to reach the queue. The default value is 49.17:02:47.295.

Type:TimeSpan
Aliases:TTRQ
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Object

Outputs

Object