How to convert value to mb powershell script

$h = @{}
get-wmiobject win32_process | foreach {
$u = $.getowner().user;
if ( $u -ne $null)
{
if ( !$h.ContainsKey($u) )
{
$h.add( $u, $
.PrivatePageCount);
}
else
{
$h.item($u) = $h.item($u) + $_.PrivatePageCount;
}
}
}
$h.GetEnumerator() | sort value -desc

8388608 / 1MB
or
16777216 / 1MB

where write that?
Because i don’t know much, thank you

Where do you want the value converted to MB?

with getenumerator because the Value is a property

You could use a Select-Object with a calculated property

…  | Select-Object -Property Name,@{Name=‘Value’;Expression={$_.Value / 1MB}}

Thank you. it works :wink:
Great