public static void GetMemoryShapshot(MemorySnapshotCmdletBase cmdlet, int[] processIds) { if (null != processIds && 0 < processIds.Length) { foreach (int processId in processIds) { MemorySnapshot snapshot = MemorySnapshot.FromProcess(processId); cmdlet.WriteObject(cmdlet, snapshot); } } }