Search notes:

PowerShell Cmdlet: Get-Process

get-process returns objects whose type is System.Diagnostics.Process.
ps is an alias for get-process.

Terminating a process

A process can be terminated with the returned object's Kill() method, for example because the process in question is hanging:
PS:\> (get-process excel).kill()

Selecting specific processes

Property value

By combining get-process and where-object in a pipeline, it's possible to select processes by criterias applied on their properties:
get-process  | where-object name -match app
Select processes whose process memory (pm) is greater than 250 mega bytes:
get-process  | where-object pm -gt 250mb

-id / (Process identifier)

The -id option allows to select a process by its process identifier.
get-process -id $PID | select-object startTime, totalProcessorTime, userProcessorTime, virtualMemorySize, workingSet

Select my session's processes

get-process | where-object {
   $_.SI -eq ([System.Diagnostics.Process]::GetCurrentProcess().SessionId) -and
 #
 #    Exclude some well known proceses: 
 #
   $_.processName -notin
      'csrss',
      'dllhost',
      'dwm',
      'explorer',
      'RuntimeBroker',
      'SecurityHealthSystray',
      'ShellExperienceHost',
      'sihost',
      'svchost',
      'taskhostw', 
      'unsecapp',
      'winlogon',
     # WSL related
      'wsl', 'wslrelay', 'wslhost'
}
TODO: Is TextInputHost a well-known process as well?

See also

Using the cmdlet get-counter to find processor intensive processes.
get-process is one of the cmdLets with the -computerName parameter.
process
Powershell command noun: process

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758187165, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/command-inventory/noun/process/get/index(100): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78