In this post, we will show you how to remove or disable PowerShell v2 using Local Security Policy, PowerShell or Windows Features in Windows 11/10. It is still enabled in Windows systems, and this can be used to bypass event logging by threat actors. So it is best to disable it.
How to disable PowerShell v2 in Windows 11/10
To disable PowerShell v2 in Windows 11/10, follow these methods:
- Using Windows Features
- Using Local Security Policy
- Using PowerShell
- Using Command Prompt
To learn more about these methods in detail, continue reading.
1] Using Windows Features
It is probably the easiest way to get rid of Windows PowerShell 2.0 from Windows 11 and Windows 10 computers. You do not need to take the help of third-party applications since Windows Features is an in-built utility that allows users to enable or disable certain features.
To disable PowerShell v2 using Windows Features, follow these steps:
- Search for windows features in the Taskbar search box.
- Click on the individual search result.
- Remove the tick from the Windows PowerShell 2.0 checkbox.
- Click the OK button.
- Let it finish the process.
Finally, restart your computer to get the change.
2] Using Local Security Policy
Local Security Policy is yet another in-built utility that allows users to set various policies regarding Windows security. You can use the same to disable or block PowerShell 2.0 in Windows 11/10 PC.
To disable PowerShell v2 using Local Security Policy, follow these steps:
- Search for local security policy in the Taskbar search box.
- Click on the search result.
- Right-click on the Software Restriction Policies.
- Select the New Software Restriction Policies option.
- Right-click on the Additional Rules option.
- Select the New Hash Rule option.
- Click on the Browse button.
- Enter this path: %SystemRoot%\system32\WindowsPowerShell
- Select the powershell.exe file and click the Open button.
- Ensure that the Disallowed option is selected in the Security level menu.
- Click the OK button.
However, this solution might not work if you cannot find the v2.0 in the WindowsPowerShell folder.
3] Using PowerShell
You can use a simple command in Windows PowerShell to disable or enable PowerShell 2.0 on Windows 11 or Windows 10 computers. However, before doing that, you need to open Windows PowerShell with administrator permission. Then, you need to check the current state of PowerShell 2.0. For that, enter this command:
Get-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2
If the State is being displayed as Disabled, you do not need to do anything else. However, if it is showing Enabled status, you need to enter this command:
Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root
Now, you can enter the first command to check the status.
However, if you want to re-enable Windows PowerShell 2.0, enter this command:
Enable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root
4] Using Command Prompt
Like Windows PowerShell, you can use the Command Prompt to get the job done. This time, you need to take the help of the DISM tool or parameter. Therefore, to get started, open elevated Command Prompt window first. Then, enter this command to check the current status:
DISM /online /get-features /format:table | find "MicrosoftWindowsPowerShellV2Root"
If it is showing as Enabled, enter the following command to disable PowerShell v2:
Dism /online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root"
On the other hand, if you want to enable it, use this command:
Dism /online /Enable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root" -All
For your information, you can use the same commands in the Windows Terminal as well. For that, you need to open the respective instance of Windows PowerShell or Command Prompt first.
How do I disable PowerShell v2?
There are multiple methods to disable PowerShell v2 on Windows 11 and Windows 10. For example, you can use Windows Features, Local Security Policy, Windows PowerShell, and Command Prompt to get the job done. However, if you want to disable Windows PowerShell from top to bottom, you can use the Local Group Policy Editor and Registry Editor as well.
How do I disable PowerShell in Windows 11?
To disable PowerShell in Windows 11, you can use three different methods – Local Security Policy, Local Group Policy Editor, and Registry Editor. Using the Local Security Policy is the most common practice when it comes to disabling the PowerShell utility on your computer. Whether it is Windows 11 or Windows 10, you can go through the same methods to get the job done.
That’s all! Hope these guides helped you.