1
Vote

new-scqueue - Unable to use -OR operator in Filter

description

The following error is thrown when attempting to use -OR operator in the Filter:

___new-scqueue : OR is not allowed, only '-AND'
At C:\Scripts\Duplicate_Queues.ps1:25 char:1
  • new-scqueue -name $queueName -ManagementPack $mp -Class $class -Filter $filter - ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (Status -ne 'Clo...b-8f3e95e19417':String) [New-SCQueue], InvalidOperationException
    • FullyQualifiedErrorId : Bad Filter,SMLets.NewSCQueueCommand___
An example to why you might need to add an OR operator:

Status != "Closed"
AND
Priority = "1"
AND
SupportGroup = Group1
OR
SupportGroup = Group2
OR
SupportGroup = Group3

comments