Why do we need to use bracket to get result ?
-
Thursday, June 21, 2012 10:16 AMHello,
I don t understand when we use the command GET-MAILBOXDATABASE and GET-MAILBOX on cmdlet select , it is necessary to add parentheses (brackets) to get a result.
Not run
Get-MailboxDatabase | select Identity,@{n='Total Mailbox';e={(Get-Mailbox -Database $_.Identity -ResultSize "Unlimited").count}}
It s run
(Get-MailboxDatabase) | select Identity,@{n='Total Mailbox';e={(Get-Mailbox -Database $_.Identity -ResultSize "Unlimited").count}}
Do you have an idea or an explanation ..
Thank you very much
Sylvain
All Replies
-
Thursday, June 21, 2012 3:20 PMweird, what is the error you get when you run it without the ()?
Justin Rich
http://jrich523.wordpress.com
PowerShell V3 Guide (Technet)
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Tuesday, July 03, 2012 3:07 AMModerator
Hi,
Based on my research, you have asked the issue some other related forums, as we can see that they could run both command without error, so, to analysis this issue, we should know the message you recieved, please give more information to work further with this issue.
Regards,
Yan Li
Yan Li
TechNet Community Support
- Proposed As Answer by Mike CrowleyMVP Tuesday, July 03, 2012 3:23 PM
-
Tuesday, July 03, 2012 3:23 PM
Agreed. Stop asking duplicate questions in multiple forums and then not providing more information when asked:
Mike Crowley | MVP
My Blog -- Planet Technologies


