PowerShell

PowerShell

You can also get the equivalent of less by piping the output to out-host -paging

PowerShell Critical Commands

Set-ExecutionPolicy

WMI/CMI Commands

The commands below are equivalent to the WMIC commands for process investigation

  1. Get list of all processes
    1. Get-WmiObject Win32_Process | Select-Object *
    2. Get-CimInstance Win32_Process | Select-Object *
  2. Get list of process names, parent process IDs, and process IDs
    1. Get-WmiObject Win32_Process | Select-Object Name, ParentProcessId, ProcessId
    2. Get-CimInstance Win32_Process | Select-Object Name, ParentProcessId, ProcessId
  3. Get process and instance ID
    1. Get-WmiObject Win32_Process -Filter "ProcessId = [PID]" | Select-Object CommandLine
    2. Get-CimInstance Win32_Process -Filter "ProcessId = [PID]" | Select-Object CommandLine

Metadata

Sources

Tags

#tools_win


  1. Though some common commands have aliases that match the shorter version. ↩︎

  2. Command type, version, source, etc. ↩︎

  3. Get-Help Get-Help will get help on the Get-Help command. ↩︎

  4. Non-Windows computers running PowerShell are Unrestricted by default. ↩︎