

I think, therefor, the PowerShell console that is a child process of Visual Studio IDE is also ignoring the Ctrl + C.Īfter thinking for a while, I tried to solve this issue by calling SetConsoleCtrlHandler Win32 API in the PowerShell console in-process. I guess, Visual Studio IDE (or any extensions live in it) calls SetConsoleCtrlHandler Win32 API to ignore to default behavior of Ctrl + C key pressing. This Win32 API allows a Win32 process to customize the behavior of Ctrl + C key is pressed.Īnd, this is an important point, the document says the effect of changing this behavior inherits to the child process! Only the PowerShell which is a child process of Visual Studio IDE has the problem.Īfter for a long hour my investigation with internet searching, I found SetConsoleCtrlHandler Win32 API. Pressing Ctrl + C keys can terminate a command when it is running.

#Cmd c powershell windows
In the PowerShell console which is opened NOT from Visual Studio IDE, such as from start menu or from Windows Explorer menu or from "Run" box or etc., Ctrl + C is working very fine expectedly.
#Cmd c powershell windows 10
Step 1: Press the ctrl + shift + Esc buttons together in windows 10 or 8 to open the task manager. Run PowerShell as an Administrator from Task Manager Step 4: It will bring up an elevated Windows PowerShell as an administrator. Step 2: Now, the command prompt will turn to Windows PowerShell. Step 1: Open the Command Prompt, and type the PowerShell as a command, then press Enter key. Run PowerShell as an Administrator from Command prompt It will open a Windows PowerShell which will run as an administrator. Step 2: Right-click on the Windows PowerShell and then select the run as administrator. Step 1: Windows 10 comes with a Cortana search field in the taskbar. Run PowerShell as an Administrator using Cortana Search bar (for Windows 10) Step 4: The above command will bring up an elevated Windows PowerShell as an administrator. Step 3: Type the command start-process PowerShell -verb runas and press " enter" key. A normal Window PowerShell will launch as a current user. Step 2: Type the PowerShell in the box and click OK button. waithidden cmd.exe /C powershell.exe -executionpolicy bypass -file example.ps1 > c:ps.log Thanks willougd for your help.

Step 1: Press the Windows + R keys together to bring up the Run dialog box.

Run PowerShell as an Administrator using the run window
