How to Stop a Long Running Cmdlet in Powershell

Let's say I run this cmdelt :

C:\> Get-EventLog Application

This cmdlet takes forever showing events and never stops, is there a certain command or something I can type to stop it and return to my C:\> ?

2 Answers

This depends on the environment you are working in.

Ctrl + C works in the PowerShell console and ISE. I use the PowerGUI script editor and to achieve the same I use Shift + F5.

Hit Ctrl + C to break the cmdlet in process, returning you to the C: prompt.

Ctrl + C
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest