Published by


Brink's Avatar
Administrator

Posts: 33,147

Show Printable Version 


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:

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





Enable or Disable Windows PowerShell 2.0 in Windows 10 OPTION ONE Enable or Disable Windows PowerShell 2.0 in Windows 10
Enable or Disable Windows PowerShell 2.0 in Windows Features

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)

Name:  Windows_Features.jpg
Views: 2536
Size:  57.9 KB

3. Check (enable - default) or uncheck the Windows PowerShell 2.0 box for what you want, and click/tap on OK. (see screenshots below)

Name:  PowerShell_2_Windows_Features-1.png
Views: 2527
Size:  24.6 KB Name:  PowerShell_2_Windows_Features-2.png
Views: 2520
Size:  25.4 KB

4. Click/tap on Close when it has finished. (see screenshot below)

Name:  PowerShell_2_Windows_Features-3.png
Views: 2519
Size:  13.0 KB

5. You can now close Programs and Features if you like.






Enable or Disable Windows PowerShell 2.0 in Windows 10 OPTION TWO Enable or Disable Windows PowerShell 2.0 in Windows 10
Enable or Disable Windows PowerShell 2.0 in PowerShell

1. Open an elevated PowerShell.

2. Do step 3 (check), step 4 (enable), or step 5 (disable) below for what you want to do.


 3. To Check Current State (Enabled or Disabled) of Windows PowerShell 2.0

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.

Name:  Check_PowerShell_2_state-1.png
Views: 2517
Size:  18.4 KB Name:  Check_PowerShell_2_state-2.png
Views: 2532
Size:  18.6 KB


 4. To Enable Windows PowerShell 2.0

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

Name:  Enable_PowerShell_2.jpg
Views: 2531
Size:  29.0 KB


 5. To Disable Windows PowerShell 2.0

A) Copy and paste the command below into the elevated PowerShell, and press enter. (see screenshot below)

Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root

Name:  Disable_PowerShell_2.jpg
Views: 2516
Size:  26.8 KB

6. You can now close the elevated PowerShell if you like.






Enable or Disable Windows PowerShell 2.0 in Windows 10 OPTION THREE Enable or Disable Windows PowerShell 2.0 in Windows 10
Enable or Disable Windows PowerShell 2.0 in Command Prompt

1. Open an elevated PowerShell.

2. Do step 3 (check), step 4 (enable), or step 5 (disable) below for what you want to do.


 3. To Check Current State (Enabled or Disabled) of Windows PowerShell 2.0

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.

Name:  Check_PowerShell_2_state_command-1.jpg
Views: 2510
Size:  29.6 KB Name:  Check_PowerShell_2_state_command-2.jpg
Views: 2514
Size:  29.7 KB


 4. To Enable Windows PowerShell 2.0

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

Name:  Enable_PowerShell_2_command.jpg
Views: 2521
Size:  43.0 KB


 5. To Disable Windows PowerShell 2.0

A) Copy and paste the command below into the elevated command prompt, and press enter. (see screenshot below)

Dism /online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root"

Name:  Disable_PowerShell_2_command.jpg
Views: 2523
Size:  44.6 KB

6. You can now close the elevated command prompt if you like.


That's it,
Shawn