Remove-MsmqQueue

Deletes queues.

Syntax

Remove-MsmqQueue
      -InputObject <MessageQueue[]>
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-MsmqQueue cmdlet deletes queues. Specify queues to delete by using MsmqQueue objects. This cmdlet does not return anything.

Examples

Example 1: Remove public queues that have specified names

PS C:\> Get-MsmqQueue -Name "Order*" -QueueType Public | Remove-MsmqQueue

This command gets public queues that have names that start with the string Order by using the Get-MsmqQueue cmdlet. The command passes the results to the current cmdlet by using the pipeline operator. The current cmdlet removes the queues.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Specifies an array of MsmqQueue objects. This cmdlet deletes the queues that the MsmqQueue objects specify. This parameter accepts pipeline input.

Type:MessageQueue[]
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Msmq.PowerShell.Commands.MessageQueue[]

Outputs

Object