ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Free Task Manager total resources for multiple instances?

<< < (4/5) > >>

AbteriX:
 
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++ ---#Requires -version 2.0$host.version $myProcess = "TOTALCMD"$ProcessData = get-process $myProcess -ErrorAction SilentlyContinueif ($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
--- End quote ---



 

MilesAhead:
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++ ---#Requires -version 2.0$host.version $myProcess = "TOTALCMD"$ProcessData = get-process $myProcess -ErrorAction SilentlyContinueif ($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
--- End quote ---



 
-AbteriX (July 01, 2015, 07:03 AM)
--- End quote ---

DK2IT:
First time also I have got several error with PowerShell and this script  >:(
If I remember well, you must enable some authorization, and when you launch by commandline you must enter the FULL path of the script.

MilesAhead:
First time also I have got several error with PowerShell and this script  >:(
If I remember well, you must enable some authorization, and when you launch by commandline you must enter the FULL path of the script.
-DK2IT (July 01, 2015, 08:38 AM)
--- End quote ---

I changed the setting to unrestricted.  But as I mentioned before, running the script the cursor just goes back to the prompt. No error no nothing.  I have no intention of doing stuff with Powershell so it is not really worth delving into it. In fact I should probably change the setting back to block scripts.

I am just surprised no task manager clone I tried does this.  I wonder if Linux top command does.  Most likely it did a decade ago.  :)

DK2IT:
Well, you can try to get something similar with tasklist and an AWK for windows or similar (like advanced calculation using FOR command).
For task manager, try Process Hacker, work quite well.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version