CmdID / PowerShell / Cmdlets / Stop
Stop-Process
Stops one or more running processes. PowerShell reference
From the PowerShell reference
7 parameters
Aliases kill, spps
What it does
Stops one or more running processes. The Stop-Process cmdlet stops one or more running processes. You can specify a process by process name or process ID (PID), or pass a process object to Stop-Process. Stop-Process works only on processes running on the local computer. On Windows Vista and later versions of the Windows operating system, to stop a process that is not owned by the current user, you must start PowerShell by using the Run as administrator option. Also, you are not prompted for confirmation unless you specify the Confirm parameter.
Stop-Process [-Id] <Int32[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]Stop-Process -Name <String[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]Stop-Process [-InputObject] <Process[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
Stop all instances of a process
PS C:> Stop-Process -Name "notepad"IdentifyStop a specific instance of a process
PS C:> Stop-Process -Id 3952 -Confirm -PassThruIdentifyStop a process and detect that it has stopped
calc
$p = Get-Process -Name "calc"
Stop-Process -InputObject $p
Get-Process | Where-Object {$_.HasExited}IdentifyStop a process not owned by the current user
PS> Get-Process -Name "lsass" | Stop-ProcessIdentifyIts page in the reference: Stop-Process.
Parameters
-ForceStops the specified processes without prompting for confirmation. By default, Stop-Process prompts for confirmation before stopping any process that is not owned by the current user.
To find the owner of a process, use the Get-CimInstance cmdlet to get a Win32_Process object that represents the process, and then use the GetOwner method of the object.-IdSpecifies the process IDs of the processes to stop. To specify multiple IDs, use commas to separate the IDs. To find the PID of a process, type Get-Process.-InputObjectSpecifies the process objects to stop. Enter a variable that contains the objects, or type a command or expression that gets the objects.-NameSpecifies the process names of the processes to stop. You can type multiple process names, separated by commas, or use wildcard characters.-PassThruReturns an object that represents the process. By default, this cmdlet does not generate any output.-ConfirmPrompts you for confirmation before running the cmdlet.-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.