Edit

Share via


New-MsmqMessage

Creates a message object.

Syntax

Default (Default)

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.

Parameter properties

Type:AcknowledgeTypes
Default value:None
Accepted values:None, PositiveArrival, PositiveReceive, NotAcknowledgeReachQueue, FullReachQueue, NegativeReceive, NotAcknowledgeReceive, FullReceive
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AdminQueuePath

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Authenticated

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Body

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

Parameter properties

Type:Object
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Journaling

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Label

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Recoverable

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResponseQueuePath

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False
Aliases:TTBR

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:TimeSpan
Default value:None
Supports wildcards:False
DontShow:False
Aliases:TTRQ

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Object

Outputs

Object