You are currently viewing Powershell Command Memo for Windows

Powershell Command Memo for Windows

This article presents some useful Powershell commands for extracting information about machines. It is not exhaustive and will be completed over time. It is a collection of commands that can be found on different sites. This memo of Powershell commands avoids searching everywhere for commands that are often used but sometimes forgotten.

Displaying the most RAM-intensive processes

It is possible to find the processes that consume the most resources without going through the task manager. This piece of code can be very useful for monitoring purposes. Here, only the 10 most greedy processes are displayed (select -first 10), but it is of course possible to modify this variable.

get-wmiobject WIN32_PROCESS |
Sort-Object -Property ws -Descending|
select -first 10|
Select processname, @{Name="Mem Usage(MB)";Expression={[math]::round($_.ws / 1mb)}},@{Name="ProcessID";Expression={[String]$_.ProcessID}},@{Name="UserID";Expression={$_.getowner().user}} 
Memo Powershell Windows : Process gourmands

Afficher toutes les classes pour un espace WMI donné

get-wmiobject -namespace root\ccm\clientsdk -list | select __Path -Expand Methods | select Origin, Name, __Path | out-gridview

Leave a Reply