1876
General Software Discussion / Re: Free Task Manager total resources for multiple instances?
« Last post by MilesAhead on July 01, 2015, 07:32 AM »And how are you running this script? I don't think I've seen a powershell I've tried that ran as advertised. There's always some gotcha'
But no need for PSv4, the above script even works in PSv2 and v3
One can test in launching PS as: powershell -version 2.0
And you can force a script to run a specific PS version
(Both above mentioned ways if required PS and .NET version is installed)Code: C++ [Select]
#Requires -version 2.0 $host.version $myProcess = "TOTALCMD" $ProcessData = get-process $myProcess -ErrorAction SilentlyContinue if ($ProcessData -ne $null) { $m = ps $myProcess | measure PM -Sum ; ("$myProcess Physical Memory {0:N2}MB " -f ($m.sum / 1mb)) $m = ps $myProcess | measure WS -Sum ; ("$myProcess Working Set {0:N0}MB " -f ($m.sum / 1mb)) } read-host Done! Press Enter to exit...Major Minor Build Revision
----- ----- ----- --------
4 0 -1 -1
TOTALCMD Physical Memory 20,09MB
TOTALCMD Working Set 37MB
Done! Press Enter to exit...:
Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1
TOTALCMD Physical Memory 20,15MB
TOTALCMD Working Set 37MB
Done! Press Enter to exit...:-Output
-AbteriX (July 01, 2015, 07:03 AM)

Recent Posts


