<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Get-Process command in PowerShell - Windows OS				            </title>
            <link>https://www.hacktheforum.com/windows-os/get-process-command-in-powershell/</link>
            <description>Hack The Forum Discussion Board</description>
            <language>en</language>
            <lastBuildDate>Thu, 16 Apr 2026 21:38:37 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Get-Process command in PowerShell</title>
                        <link>https://www.hacktheforum.com/windows-os/get-process-command-in-powershell/#post-858</link>
                        <pubDate>Thu, 12 Dec 2024 19:47:07 +0000</pubDate>
                        <description><![CDATA[The Get-Process cmdlet in PowerShell is used to retrieve information about the processes that are running on a local or remote computer. This cmdlet provides details such as the process name...]]></description>
                        <content:encoded><![CDATA[<div class="flex-1 overflow-hidden @container/thread">
<div class="h-full">
<div class="react-scroll-to-bottom--css-orznh-79elbk h-full">
<div class="react-scroll-to-bottom--css-orznh-1n7m0yu">
<div class="flex flex-col text-sm md:pb-9">
<article class="w-full scroll-mb- text-token-text-primary focus-visible:outline-2 focus-visible:outline-offset-" dir="auto" data-testid="conversation-turn-17" data-scroll-anchor="true">
<div class="m-auto text-base py- px-3 md:px-4 w-full md:px-5 lg:px-4 xl:px-5">
<div class="mx-auto flex flex-1 gap-4 text-base md:gap-5 lg:gap-6 md:max-w-3xl">
<div class="group/conversation-turn relative flex w-full min-w-0 flex-col agent-turn">
<div class="flex-col gap-1 md:gap-3">
<div class="flex max-w-full flex-col flex-grow">
<div class="min-h-8 text-message flex w-full flex-col items-end gap-2 whitespace-normal break-words text-start :mt-5" dir="auto" data-message-author-role="assistant" data-message-id="b47df5cd-3dd4-4558-ad2c-70b913ff9f58" data-message-model-slug="gpt-4o-mini">
<div class="flex w-full flex-col gap-1 empty:hidden first:pt-">
<div class="markdown prose w-full break-words dark:prose-invert light">
<p>The <code>Get-Process</code> cmdlet in PowerShell is used to retrieve information about the processes that are running on a local or remote computer. This cmdlet provides details such as the process name, process ID, memory usage, CPU time, and more. You can use it to monitor system performance, troubleshoot issues, or collect data for system administration tasks.</p>
<h3>Basic Syntax:</h3>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process
</pre>
</div>
</div>
<h3>Example 1: List All Running Processes</h3>
<p>Running <code>Get-Process</code> without any parameters will list all the processes currently running on your local machine.</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process
</pre>
</div>
</div>
<p>This will output a list of processes, showing the <strong>Name</strong>, <strong>ID</strong>, <strong>Handles</strong>, <strong>NPM (Non-paged memory)</strong>, <strong>PM (Paged memory)</strong>, <strong>WS (Working set)</strong>, and <strong>CPU</strong> time, among other details.</p>
<h3>Example 2: Get Specific Process by Name</h3>
<p>You can filter processes by their <strong>name</strong>. For example, to get all processes related to <strong>"chrome"</strong> (Google Chrome):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process -Name chrome
</pre>
</div>
</div>
<p>This will list all running <strong>chrome</strong> processes.</p>
<h3>Example 3: Get Process by Process ID (PID)</h3>
<p>You can retrieve a process using its <strong>PID</strong> (Process ID). For instance, to get the process with PID 1234:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process -Id 1234
</pre>
</div>
</div>
<p>This will return information about the process with the specified PID.</p>
<h3>Example 4: Get Multiple Processes by Name</h3>
<p>You can also specify multiple processes by separating their names with commas. For example:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process -Name chrome, firefox, explorer
</pre>
</div>
</div>
<p>This will return information about processes related to <strong>chrome</strong>, <strong>firefox</strong>, and <strong>explorer</strong>.</p>
<h3>Example 5: Display Specific Properties of Processes</h3>
<p>You can select specific properties of the processes to make the output more readable. For example, to display the <strong>Name</strong>, <strong>ID</strong>, <strong>CPU time</strong>, and <strong>Memory</strong> of each process:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Select-Object Name, Id, CPU, WorkingSet
</pre>
</div>
</div>
<p>This will show a simplified output with just the <strong>Name</strong>, <strong>ID</strong>, <strong>CPU</strong>, and <strong>WorkingSet</strong> (memory usage) of each process.</p>
<h3>Example 6: Sort Processes by Memory Usage</h3>
<p>To sort the processes by memory usage (working set), use the following command:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Sort-Object WorkingSet -Descending
</pre>
</div>
</div>
<p>This will list the processes, sorted by memory usage in descending order.</p>
<h3>Example 7: Get Process on a Remote Machine</h3>
<p>If you want to get processes from a remote machine, use the <code>-ComputerName</code> parameter. For example:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process -ComputerName "RemotePCName"
</pre>
</div>
</div>
<p>This command retrieves the processes from the remote computer specified by <strong>RemotePCName</strong>.</p>
<h3>Example 8: Limit the Output to Top N Processes</h3>
<p>To limit the number of processes returned, you can use <code>Select-Object</code> to return only the top N processes. For example, to get the top 5 processes by CPU usage:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Sort-Object CPU -Descending | Select-Object -First 5
</pre>
</div>
</div>
<p>This will show the top 5 processes sorted by their CPU usage in descending order.</p>
<h3>Example 9: Get Process for Specific User</h3>
<p>To retrieve processes run by a specific user, you can use the <code>Get-WmiObject</code> cmdlet along with <code>Get-Process</code>. Here's an example:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-WmiObject -Class Win32_Process | Where-Object { $_.Owner -eq "username" }
</pre>
</div>
</div>
<p>Replace <strong>"username"</strong> with the actual username. This command fetches processes based on the specified user.</p>
<h3>Example 10: Display Processes with Memory and CPU Usage</h3>
<p>To display detailed information on processes, including their memory and CPU usage, you can run:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Select-Object Name, Id, CPU, WorkingSet, PrivateMemorySize
</pre>
</div>
</div>
<p>This shows the <strong>Name</strong>, <strong>Id</strong>, <strong>CPU time</strong>, <strong>WorkingSet</strong> (memory), and <strong>PrivateMemorySize</strong> (private memory allocated to the process).</p>
<h3>Example 11: Killing a Process</h3>
<p>If you want to stop a process, you can use the <code>Stop-Process</code> cmdlet. For example, to kill a process by name (e.g., <strong>notepad</strong>):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Stop-Process -Name notepad
</pre>
</div>
</div>
<p>Or, if you know the <strong>PID</strong>:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Stop-Process -Id 1234
</pre>
</div>
</div>
<h3>Example 12: Getting Process in a Specific Session</h3>
<p>You can filter processes by their session ID. For example:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Format-Table -Property Name, Id, CPU, WorkingSet
</pre>
</div>
</div>
<p>This will return processes running under session ID 1.</p>
<h3>Example 13: Displaying Processes in a Specific Format (Table, List, or Grid)</h3>
<p>You can display the output in different formats, such as <strong>table</strong>, <strong>list</strong>, or <strong>grid</strong>. For example:</p>
<ul>
<li>
<p><strong>Table</strong> format (default):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Format-Table -Property Name, Id, CPU, WorkingSet
</pre>
</div>
</div>
</li>
<li>
<p><strong>List</strong> format (for detailed info):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Format-List -Property Name, Id, CPU, WorkingSet
</pre>
</div>
</div>
</li>
<li>
<p><strong>Grid</strong> format (for a more interactive view):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Out-GridView
</pre>
</div>
</div>
</li>
</ul>
<h3> </h3>
<p>The <code>Get-Process</code> cmdlet in PowerShell is a powerful tool for managing and monitoring processes on a local or remote computer. You can filter, sort, display, and even manipulate processes using various parameters and techniques, making it an essential cmdlet for system administrators and users performing troubleshooting or monitoring tasks.</p>
</div>
</div>
</div>
</div>
<div class="mb-2 flex gap-3 empty:hidden -ml-2">
<div class="items-center justify-start rounded-xl p-1 flex">
<div class="flex items-center"> </div>
</div>
</div>
<div class="pr-2 lg:pr-0"> </div>
<div class="mt-3 w-full empty:hidden">
<div class="text-center"> </div>
</div>
</div>
<div class="absolute">
<div class="flex items-center justify-center"> </div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</div>
</div>
<div class="md:pt-0 dark:border-white/20 md:border-transparent md:dark:border-transparent w-full">
<div>
<div class="m-auto text-base px-3 md:px-4 w-full md:px-5 lg:px-4 xl:px-5">
<div class="mx-auto flex flex-1 gap-4 text-base md:gap-5 lg:gap-6 md:max-w-3xl">
<div class="flex justify-center"> </div>
</div>
</div>
</div>
</div>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/get-process-command-in-powershell/#post-858</guid>
                    </item>
							        </channel>
        </rss>
		