I need to run exchange cmdlets from a c# console application.
I followed the guide from http://msdn.microsoft.com/en-us/library/bb332449.aspx for a simple command with a single parameter
The cmdlets I need to run is:
Get-MailboxStatistics -server evs | Select servername, StorageGroupName,databasename,@{expression={$_.TotalItemSize.value.ToKB()}},ItemCount,mailboxguid
I cannot specify the field that I need after the select
command and I don't know how I can pass the expression @{expression={$_.TotalItemSize.value.ToKB()}}
to cmdlets.
Is there a way to do it in managed code?