![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Zero did not appear / Where is my scalar value - zero ? i have some security groups with NO membership. $count = get-qadgroupmember <grps> $count looks to be empty. But i want the $count to display 0 |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Zero did not appear / Where is my scalar value - zero ? "IT Staff" <jkklim@xxxxxx> wrote in message news:#0ADi$xGKHA.5956@xxxxxx Quote: > i have some security groups with NO membership. > > $count = get-qadgroupmember <grps> > $count looks to be empty. > > But i want the $count to display 0 > as an array, even if the array has zero or only one member. Do this: $members = @(get-qadgroupmember <grps>) Note that I call this $members, not count - get-qadgroupmember returns member objects, not a count of members. In any case, if you then check $members.Count you'll have the count of members from <grps>. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Zero did not appear / Where is my scalar value - zero ? Hi IT, You need to force the rsult to an array so you'll have a count property, scalas dont have count: (get-qadgroupmember <grps>).count --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar IS> i have some security groups with NO membership. IS> IS> $count = get-qadgroupmember <grps> IS> $count looks to be empty. IS> But i want the $count to display 0 IS> |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Zero did not appear / Where is my scalar value - zero ? I had a typo, should be: @(get-qadgroupmember <grps>).count --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar SL> Hi IT, SL> SL> You need to force the rsult to an array so you'll have a count SL> property, scalas dont have count: SL> SL> (get-qadgroupmember <grps>).count SL> SL> --- SL> Shay Levy SL> Windows PowerShell MVP SL> http://blogs.microsoft.co.il/blogs/ScriptFanatic SL> PowerShell Toolbar: http://tinyurl.com/PSToolbar IS>> i have some security groups with NO membership. IS>> IS>> $count = get-qadgroupmember <grps> IS>> $count looks to be empty. IS>> But i want the $count to display 0 |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Execute Scalar Stored Procedures in Entity Framework | .NET General | |||