New-MsmqMessage

Creates a message object.

Syntax

New-MsmqMessage
   [[-Body] <Object>]
   [-AcknowledgeType <AcknowledgeTypes>]
   [-AdminQueuePath <String>]
   [-Authenticated]
   [-Journaling]
   [-Label <String>]
   [-Recoverable]
   [-ResponseQueuePath <String>]
   [-TimeToBeReceived <TimeSpan>]
   [-TimeToReachQueue <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.

Optional Parameters

-AcknowledgeType

{{Fill AcknowledgeType Description}}

Type:AcknowledgeTypes
Parameter Sets:None, PositiveArrival, PositiveReceive, NotAcknowledgeReachQueue, FullReachQueue, NegativeReceive, NotAcknowledgeReceive, FullReceive
Position:Named
Default value:None
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
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
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
Accept pipeline input:True (ByValue)
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
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
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
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
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
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
Accept pipeline input:False
Accept wildcard characters:False