Quota values in bytes, removing "friendly" formatting when using c
Hi,
I'm trying to get the values of ProhibitSendReceiveQuota and others in C#.
However I need to get the values in their Byte value (because im comparing
them to values set previously, also from code).
I cant find a way to ask for *just* B, rather than PowerShell giving me KB,
MB, GB depending on how big the value is. Is there a way to stop PowerShell
giving me the automatically formatted, human "friendly" values?
Here is a code snippet to give you an idea:
Command cmd = new Command("get-mailbox");
cmd.Parameters.Add(new CommandParameter("Identity", username));
...
Collection<PSObject> results = pipeline.Invoke();
long softquota = (long)results[0].Properties["IssueWarningQuota"].Value;
...last line fails with invalid cast, but hopefully shows you what im trying
to do.
Mark
date: Tue, 15 Apr 2008 09:36:00 -0700
author: m.r.wallis