How to Enable or Disable Windows PowerShell 2.0 in Windows 10
Windows PowerShell is a task-based command-line shell and scripting language designed especially for system administration. Built on the .NET Framework, Windows PowerShell helps IT professionals and power users control and automate the administration of the Windows operating system and applications that run on Windows.
Windows 10 includes Windows PowerShell 5.0 by default that has some great new features that enhance security including enhanced transcription logging and AMSI protection.
However, the Windows PowerShell 2.0 engine is still enabled and is now recognized as a security risk that can be used to run malicious scripts.
While Windows PowerShell 2.0 has been deprecated starting with Windows 10 Fall Creators Update, it may still be enabled on your system.
For more details about Windows PowerShell, see:
- Microsoft PowerShell | Microsoft Docs
- What's New With PowerShell 5.0 | Microsoft Docs
- Cool Stuff about PowerShell 5 in Windows 10 - Hey, Scripting Guy! Blog
This tutorial will show you how to enable or disable Windows PowerShell 2.0 for all users in Windows 10.
You must be signed in as an administrator to enable or disable Windows PowerShell 2.0.
Contents
- Option One: Enable or Disable Windows PowerShell 2.0 in Windows Features
- Option Two: Enable or Disable Windows PowerShell 2.0 in PowerShell
- Option Three: Enable or Disable Windows PowerShell 2.0 in Command Prompt
1 Open the Control Panel (icons view), and click/tap on the Programs and Features icon.
2 Click/tap on the Turn Windows features on or off link on the left side. (see screenshot below)
3 Check (enable - default) or uncheck the Windows PowerShell 2.0 box for what you want, and click/tap on OK. (see screenshots below)
4 Click/tap on Close when it has finished. (see screenshot below)
5 You can now close Programs and Features if you like.
1 Open an elevated PowerShell.
2 Do step 3 (check), step 4 (enable), or step 5 (disable) below for what you want to do.
A) Copy and paste the command below into the elevated PowerShell, and press enter. (see screenshots below)
Get-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2
B) You will now see the current State show as Enabled or Disabled.
This is the default setting.
A) Copy and paste the command below into the elevated PowerShell, and press enter. (see screenshot below)
Enable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root
A) Copy and paste the command below into the elevated PowerShell, and press enter. (see screenshot below)
Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root
6 You can now close the elevated PowerShell if you like.
1 Open an elevated PowerShell.
2 Do step 3 (check), step 4 (enable), or step 5 (disable) below for what you want to do.
A) Copy and paste the command below into the elevated command prompt, and press enter. (see screenshots below)
DISM /online /get-features /format:table | find "MicrosoftWindowsPowerShellV2Root"
B) You will now see the current state show as Enabled or Disabled.
This is the default setting.
A) Copy and paste the command below into the elevated command prompt, and press enter. (see screenshot below)
Dism /online /Enable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root" -All
A) Copy and paste the command below into the elevated command prompt, and press enter. (see screenshot below)
Dism /online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root"
6 You can now close the elevated command prompt if you like.
That's it,
Shawn
Related Tutorials
- How to Open Windows PowerShell in Windows 10
- How to Open Elevated Windows PowerShell in Windows 10
- Show Command Prompt or Windows PowerShell on Win+X menu in Windows 10
- How to Add 'Open PowerShell window here' context menu in Windows 10
- How to Add 'Open PowerShell window here as administrator' context menu in Windows 10
- Enable or Disable Legacy Console for Command Prompt and PowerShell in Windows 10
- How to Check PowerShell Version in Windows
- How to Install PowerShell Core on Windows