PowerShell has stopped working and will not open

Windows PowerShell is a command-line and scripting tool in Windows operating systems. It is developed by Microsoft and users can use it for running batch commands, script automation, etc. To launch Windows PowerShell, simply type PowerShell in Windows Search and select PowerShell to open it. Some users are experiencing problems with PowerShell. According to them, when they launch PowerShell, a popup window appears showing them an error message. Different users have seen different error messages while launching Windows PowerShell. Some of these error messages are as follows:

  • Powershell has stopped working
  • This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default Apps Settings page.
  • This operation has been canceled due to restrictions in effect on this computer. Please contact your system administrator.

PowerShell has stopped working

If you receive any of the above-mentioned error messages while launching Windows PowerShell, the solutions explained in this article may help you fix the problem.

PowerShell has stopped working and will not open

If PowerShell has stopped working or does not open on your system, you can try the following solutions in no particular order and see if your problem is fixed.

  1. Run SFC and DISM scans
  2. Run an antimalware and an antivirus scan
  3. Change Group Policy Settings
  4. Reset Group Policy Settings
  5. Change Smadav antivirus settings
  6. Perform a System Restore
  7. Troubleshoot in a Clean Boot state
  8. Create a new user profile

Below, we have explained all these fixes in detail.

1] Run SFC and DISM scans

One possible cause of the problem that you are currently experiencing is system file corruption. Hopefully, Windows operating system has a built-in utility to repair the corrupted system files. Run an SFC scan so that your corrupted system files will get repaired successfully. Launch the Command Prompt as an administrator, type the following command, and hit Enter.

sfc /scannow

If the SFC scan does not fix your problem, run the DISM scan.

2] Run an antimalware and an antivirus scan

A lot of users have confirmed that the problem was occurring due to malware and virus infection. Malware and viruses can enter a user’s computer in many ways. The most common way is the installation of an infected program. Most users do not know about the risks of downloading software from untrusted websites. The software on unsecured websites may have malicious code that can harm your computer.

Among the affected users, most of them have stated that their systems were infected by malicious Rootkit programs. Rootkit software is generally used by cybercriminals to have control over the host’s computer so that they could steal confidential data. This might be the case with you. Therefore, we suggest you scan your system with good antimalware software, like Malwarebytes. Or you can try some free rootkit removal software. In addition to this, you should also try a Junkware removal tool to remove Adware from your system.

Some users have also reported that their systems had the Poweliks infection. Poweliks is a trojan that injects its malicious code directly into Windows Registry. A trojan has different varieties. Depending on the variant, a trojan can also download some additional malware on the infected user’s machine.

You can also use Microsoft Safety Scanner to scan your system. It will help you remove malware and viruses from your system. The tool is available on Microsoft’s official website for free. Apart from that, there are also some dedicated virus and malware removal tools that you can use.

3] Change Group Policy Settings

You might be facing the issue due to the incorrect Group Policy Settings. The “Don’t run specified Windows applications” policy should be set to Not configured in the Group Policy Editor. The following steps will guide you on how to do that. The Windows 11/10 Home users can skip this method, as Group Policy Editor is not available in Windows 11/10 Home edition. However, there is a method to install Group Policy Editor on Windows 11/10 Home.

  1. Press Win + R keys. This will launch the Run command box.
  2. Type gpedit.msc and click OK.
  3. Go to “User Configuration > Administrative Templates > System.”
  4. Double-click on Don’t run specified Windows applications and set it to Not configured.

Now, check if you can launch Windows PowerShell.

4] Reset Group Policy Settings

Virus and malware can interfere with Windows registry and Group Policy Settings. It might be possible that some of your Group Policy Settings were changed due to virus or malware infection. In such a case, resetting the Group Policy Settings to default will fix the problem.

5] Change Smadav antivirus settings

If you have installed Smadav antivirus, it might be blocking Windows PowerShell from opening. You can check it by disabling your antivirus temporarily. If after disabling the Smadav antivirus, you will be able to launch Windows PowerShell, you can fix this problem by allowing Windows Script in Smadav antivirus settings. Open Smadav antivirus, go to Protection, and then enable the Allow Windows Script option.

6] Perform a System Restore

System Restore is a Microsoft tool that helps users protect and repair their computers. When you create a system restore point, a snapshot of your system files and Windows Registry is saved as a restore point on your hard drive. If a problem occurs on your system, you can use this system restore point to take your system to the state in which your system was healthy.

Restore your system if you have created a system restore point before the problem appeared on your computer.

7] Troubleshoot in a Clean Boot state

There might be a third-party application causing a conflict with Windows PowerShell due to which you are experiencing such errors while launching the PowerShell. By troubleshooting your computer in a Clean Boot state, you can identify such a program or startup app.

In a Clean Boot state, all the extra startup applications and Windows Servcies remain disabled. This helps users identify the culprit program or startup app. After starting your computer in a Clean Boot state, launch PowerShell and see if you get the same error message as before. If not, some of the programs or startup apps are the culprit.

Now, you have to identify that program so that you can uninstall or disable it. To do so, enable some of the disabled apps in Clean Boot and restart your computer in normal mode. Now, launch PowerShell and see if the error occurs. If not, go back to the Clean Boot state and enable the next batch of disabled apps. Now restart your computer in normal mode and launch PowerShell. If the problem occurs, one of the programs that you have enabled just now is causing the problem. Start disabling the programs in the second batch one by one and launch PowerShell every time after disabling a program. This will help you identify the program causing the problem.

Once you find the problematic program or app, check if an update is available for it or uninstall it.

8] Create a new user profile

You may also experience problems just like this one if your user profile is corrupted. In order to create a new user profile, you should log in as an administrator. If the problem does not appear in the new user profile, you can copy all your data from the existing user profile to the new user profile. To do so, open File Explorer and go to the following path:

C:Users

Now, open your old user profile folder and copy all the files and folders it contains. After that, open your new user profile folder and paste the copied contents inside it. The new user profile folder is also available on the same path in File Explorer.

How do I reset Windows PowerShell?

Before you reset Windows PowerShell to default settings, we recommend you create a system restore point. To reset Windows PowerShell, you have to replace the shortcuts in the default location with the one that we have uploaded on our servers. Download the file mentioned in the linked post, extract it, and copy all the folders of Windows PowerShell. After that, open the default location of Windows PowerShell and paste the copied shortcuts there. Windows will ask you to replace the shortcuts, select the Replace option.

Why is my Windows PowerShell not opening?

If your Windows PowerShell is not opening, either your computer is infected by a virus or malware, or some of your system files are corrupted. To fix this problem, run SFC and DISM scans, scan your system with good antimalware or antivirus software, reset your Group Policy settings (not applicable for Windows 11/10 Home users), troubleshoot your computer in a Clean Boot state to check if the problem is occurring due to a third-party program conflict, etc.

Hope this helps.

Original Article