Move-MsmqMessage
Move-MsmqMessage
This cmdlet can be used to move Messages between subqueues of the same queue or between the main queue and one of its subqueues.
Syntax
Parameter Set: Transactional
Move-MsmqMessage -DestinationQueue <MessageQueue> -InputObject <MessageQueue> -Message <Message> [-Transactional] [ <CommonParameters>]
Detailed Description
This cmdlet can be used to move Messages between subqueues of the same queue or between the main queue and one of its subqueues. The cmdlet returns a Message object representing the message that was moved. Subqueues are created implicitly on move or open operations. A user retrieves subqueues using the Get-MsmqQueue cmdlet.
Parameters
-DestinationQueue<MessageQueue>
An MsmqQueue object that represents the destination queue to which the message will be moved. The destination queue can be a subqueue or the main queue.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-InputObject<MessageQueue>
An MsmqQueue object that represents the source queue from which the message will be moved. The source queue can be a subqueue or the main queue. Accepts pipelined input.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByValue) |
Accept Wildcard Characters? |
false |
-Message<Message>
A Message object representing the message to be moved.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Transactional
If specified, the message will be moved within a transaction context.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Usage Example
PS C:\> $srcQueue = Get-MSMQQueue –Private –Name "Myqueue"
$dstQueue = Get$Message = $srcQueue | Receive-MSMQQueue -Peek -MSMQQueue –Private –Name "Myqueue" –SubQueue "MySubqueue"
$srcQueue | Move-MSMQMessage –DestinationQueue $dstQueue –Message $Message
Related topics
Get-MsmqQueue