C# Exchange Powershell specified cast not valid
- by stevetaylor20
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