Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stop a long running PS cmdlet

Tags:

powershell

I've seen articles that mention hitting Ctrl+C or Ctrl+Break to stop Powershell in it's tracks but I see varied responses to this. For example if I run: dir -include *.txt -recurse And then get tired of watching screens of info I will try to break out using one of the keyboard shortcuts mentioned above but it keeps on going. Alt + F4 is the only thing that works. What is the best way to kill it instantly?

like image 298
Penfold Avatar asked Sep 19 '25 21:09

Penfold


1 Answers

Using Ctrl+C or CTRL + Break should stop any command.

For more info about breaking running scripts/commands

https://blogs.msdn.microsoft.com/powershell/2014/11/19/powershell-break-all-command/

like image 187
Jakodns Avatar answered Sep 21 '25 21:09

Jakodns