title: Get Memory (Private Working Set) of Process
body: <p>My problem is what i am getting for WorkingSet is very different than Task manager Memory (Private Working Set). I have tried various solutions written on NET but the values are far too away from matching. Kindly help me get Memory (Private Working Set) from task manager. </p>
  
  <pre><code>script += string.Format(@"$Processes = Get-Process -ComputerName {0} | Sort-Object WorkingSet -desc | Select-Object;", remoteMachineName);
  script += @"$ProcessArray= @();";
  script += @"foreach ($process in $Processes) {";
  script += @"$ProcessName = $process.ProcessName;";
  script += @"$ProcessSize = $process.WorkingSet/1KB;";
  script += @"$objAverage = New-Object System.Object;";
  script += @"$objAverage | Add-Member -type NoteProperty -name Name -value $ProcessName;";
  script += @"$objAverage | Add-Member -type NoteProperty -name Memory -value $ProcessSize;";
  script += @"$ProcessArray +=$objAverage; }; ";
  </code></pre>