Edit

Share via


Clear-MsmqOutgoingQueue

Clears outgoing queues.

Syntax

Default (Default)

Clear-MsmqOutgoingQueue
    -InputObject <OutgoingQueue[]>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Clear-MsmqOutgoingQueue cmdlet clears outgoing queues. Specify queues to clear by using MsmqOutgoingQueue objects. This cmdlet returns an MsmqOutgoingQueue object that represents the cleared outgoing queue.

Examples

Example 1: Clear outgoing message queues based on name

PS C:\> Get-MsmqOutgoingQueue -Name "Order*" | Clear-MsmqOutgoingQueue

This command gets all the outgoing message queues that have names that start with the string Order by using the Get-MsmqOutgoingQueue cmdlet. The command passes the results to the current cmdlet by using the pipeline operator. The current cmdlet clears each queue.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

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

Parameter sets

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

-InputObject

Specifies an array of MsmqOutgoingQueue objects. This cmdlet clears outgoing queues that this parameter specifies. This parameter accepts pipeline input.

Parameter properties

Type:

OutgoingQueue[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

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

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

Microsoft.Msmq.PowerShell.Commands.OutgoingQueue

Outputs

Object