C# Exchange Powershell specified cast not valid

Posted by stevetaylor20 on Stack Overflow See other posts from Stack Overflow or by stevetaylor20
Published on 2010-03-17T08:30:03Z Indexed on 2010/03/17 8:31 UTC
Read the original article Hit count: 133

Filed under:
|
|

I'm getting a specified cast error trying to return a integer, example code below:

results = pipeline.Invoke();

foreach (PSObject ps in results) { int diff = 0; Int32 exchcount = Convert.ToInt32(ps.Members["itemcount"].Value); diff = itemcount - exchcount; }

I'm trying to find out what the data type if for itemcount of the Get-Mailboxstatistics but i can't find the information, i assume it's Int, i've tried string but that does not work either. any ideas please let me know!

Thanks Steve

© Stack Overflow or respective owner

Related posts about c#

Related posts about powershell