Link to home
Start Free TrialLog in
Avatar of David Sankovsky
David SankovskyFlag for Israel

asked on

Only Get numerical Value

Hi Guys.

I'm writing a small script to get the Message count of a specific Queue.

Get-Queue -Server cas1 -Filter {DeliveryType -eq "SmartHost"} |fl MessageCount

Open in new window


The result is

MessageCount : 0

How an I modify this line to only return the actual number (without the parameter name and / or any spaces)
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeremy Weisinger
Jeremy Weisinger

Try this:
(Get-Queue -Server cas1 -Filter {DeliveryType -eq "SmartHost"}).MessageCount

Open in new window

oBdA beat me to it. :)
Avatar of David Sankovsky

ASKER

Thank you both. Worked like a charm.
Sorry, forgot to close the question.
Thanks oBdA