Can you post the code?
I tried this and it worked as expected... of course I used a ls instead of
AD object, but should be the same result.
PS C:\> $foo = ls * -recurse
PS C:\> $foo.count
PS C:\> $foo.count + $foo.count
PS C:\> $foo.count + $foo.count - ($foo.Count / 2)
"Brian Hoort" <email@example.com> wrote in message
> How can I get foo.count to return just the integer so I can perform
> arithmetic on the result?
> I'm trying to write a one-liner that will return the number of
> non-disabled users in our AD. So far I can do this by invoking a
> dsquery returning all users, piping that into a ".count -line", then
> doing another with the dsquery switch that only returns disabled
> accounts, then getting a ".count -line" on that -- that far I've gotten
> (albeit with formatted output). Then I just subtract the disabled
> count from the full and get my count -- but I can't do this because the
> object .count returns isn't just an int -- it's a big formatted text
> Any thoughts?