Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:\> ?

like image 696
AymenDaoudi Avatar asked Oct 21 '25 04:10

AymenDaoudi


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.

like image 79
andyb Avatar answered Oct 23 '25 18:10

andyb


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

Ctrl + C
like image 33
Knuckle-Dragger Avatar answered Oct 23 '25 19:10

Knuckle-Dragger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!