Enable security against PowerShell 2.0 downgrade attacks
- Windows onlyThis script improves your privacy on Windows
- Single actionThis page belongs to a script, containing basic changes to achieve a task.
- Impact: Minimum
System Functionality / Data Loss Risk: Low
This action improves privacy with minimal impact when you run the recommended script.
- Batch (batchfile)These changes use Windows system commands to update your settings.
- Administrator rights requiredThis script requires privilege access to do the system changes
- Fully reversible
You can fully restore this action (revert back to the original behavior) using this website.
The restore/revert methods provided here can help you fix issues.
Overview
See: The Windows PowerShell 2.0 feature must be disabled on the system. | stigviewer.com
Overview of default feature statuses
MicrosoftWindowsPowerShellV2
:
Feature name | MicrosoftWindowsPowerShellV2 |
Display name | Windows PowerShell 2.0 Engine |
Description | Adds or Removes Windows PowerShell 2.0 Engine |
Default (Windows 11 ≥ 23H2) | 🟢 Enabled |
Default (Windows 10 ≥ 22H2) | 🟢 Enabled |
MicrosoftWindowsPowerShellV2Root
:
Feature name | MicrosoftWindowsPowerShellV2Root |
Display name | Windows PowerShell 2.0 |
Description | Adds or Removes Windows PowerShell 2.0 |
Default (Windows 11 ≥ 23H2) | 🟢 Enabled |
Default (Windows 10 ≥ 22H2) | 🟢 Enabled |
Sources
- The Windows PowerShell 2.0 feature must be disabled on the system.. stigviewer.com. (2024).
Original: https://www.stigviewer.com/stig/windows_10/2017-02-21/finding/V-70637
Archived: https://web.archive.org/web/20240406114721/https://www.stigviewer.com/stig/windows_10/2017-02-21/finding/V-70637
Apply Now
Choose one of three ways to apply:
Download script
Download and run the script directly- No app needed
- Offline usage
- Easy-to-apply
- Free
- Open-source
Help
How to apply or restore "Enable security against PowerShell 2.0 downgrade attacks" using script
- ≈ 2 min to complete
- Tools: Web Browser
- Difficulty: Simple
- ≈ 5 instructions
- 1
Download
Download the script file by clicking on thebutton above.
Use button above to restore changes. - 2
Keep the file
If warned by your browser, keep the file. - 3
Open
Open the downloaded file. - 4
Exit
Once it's done, press any key to exit the window. - 5
Restart
Restart your computer for all changes to take effect.
Apply with privacy.sexy
Guided, automated application with safety checks- Recommended for most users
- Includes safety checks
- Free
- Open-source
- Popular
- Offline/Online usage
Help
How to apply or restore "Enable security against PowerShell 2.0 downgrade attacks" using privacy.sexy
- ≈ 3 min to complete
- Tools: privacy.sexy
- Difficulty: Simple
- ≈ 4 instructions
- 2
Choose script
- Search for the script name: Enable security against PowerShell 2.0 downgrade attacks
- Check the script by clicking on the checkbox.
- 3
Run
Click on ▶️ Run button at the bottom of the page.This button only appears on desktop version (recommended). On browser, use 💾 Save button.
- Apply
- Revert
:: Disable the "MicrosoftWindowsPowerShellV2" feature
PowerShell -ExecutionPolicy Unrestricted -Command "$featureName = 'MicrosoftWindowsPowerShellV2'; $feature = Get-WindowsOptionalFeature -FeatureName "^""$featureName"^"" -Online -ErrorAction Stop; if (-Not $feature) { Write-Output "^""Skipping: The feature `"^""$featureName`"^"" is not found. No action required."^""; Exit 0; }; if ($feature.State -eq [Microsoft.Dism.Commands.FeatureState]::Disabled) { Write-Output "^""Skipping: The feature `"^""$featureName`"^"" is already disabled. No action required."^""; Exit 0; }; try { Write-Host "^""Disabling feature: `"^""$featureName`"^""."^""; Disable-WindowsOptionalFeature -FeatureName "^""$featureName"^"" -Online -NoRestart -LogLevel ([Microsoft.Dism.Commands.LogLevel]::Errors) -WarningAction SilentlyContinue -ErrorAction Stop | Out-Null; } catch { Write-Error "^""Failed to disable the feature `"^""$featureName`"^"": $($_.Exception.Message)"^""; Exit 1; }; Write-Output "^""Successfully disabled the feature `"^""$featureName`"^""."^""; Exit 0"
:: Disable the "MicrosoftWindowsPowerShellV2Root" feature
PowerShell -ExecutionPolicy Unrestricted -Command "$featureName = 'MicrosoftWindowsPowerShellV2Root'; $feature = Get-WindowsOptionalFeature -FeatureName "^""$featureName"^"" -Online -ErrorAction Stop; if (-Not $feature) { Write-Output "^""Skipping: The feature `"^""$featureName`"^"" is not found. No action required."^""; Exit 0; }; if ($feature.State -eq [Microsoft.Dism.Commands.FeatureState]::Disabled) { Write-Output "^""Skipping: The feature `"^""$featureName`"^"" is already disabled. No action required."^""; Exit 0; }; try { Write-Host "^""Disabling feature: `"^""$featureName`"^""."^""; Disable-WindowsOptionalFeature -FeatureName "^""$featureName"^"" -Online -NoRestart -LogLevel ([Microsoft.Dism.Commands.LogLevel]::Errors) -WarningAction SilentlyContinue -ErrorAction Stop | Out-Null; } catch { Write-Error "^""Failed to disable the feature `"^""$featureName`"^"": $($_.Exception.Message)"^""; Exit 1; }; Write-Output "^""Successfully disabled the feature `"^""$featureName`"^""."^""; Exit 0"
Ijo6IFJldmVydCB0aGUgJ01pY3Jvc29mdFdpbmRvd3NQb3dlclNoZWxsVjInIGZlYXR1cmUgdG8gaXRzIGRlZmF1bHQgc2V0dGluZ3NcblBvd2VyU2hlbGwgLUV4ZWN1dGlvblBvbGljeSBVbnJlc3RyaWN0ZWQgLUNvbW1hbmQgXCIkZmVhdHVyZU5hbWUgPSAnTWljcm9zb2Z0V2luZG93c1Bvd2VyU2hlbGxWMic7ICRpZ25vcmVNaXNzaW5nT25SZXZlcnQgPSAgJGZhbHNlOyAkZGlzYWJsZWRCeURlZmF1bHQgPSAgJGZhbHNlOyAkZmVhdHVyZSA9IEdldC1XaW5kb3dzT3B0aW9uYWxGZWF0dXJlIC1GZWF0dXJlTmFtZSBcIl5cIlwiJGZlYXR1cmVOYW1lXCJeXCJcIiAtT25saW5lIC1FcnJvckFjdGlvbiBTdG9wOyBpZiAoLU5vdCAkZmVhdHVyZSkgeyBpZiAoJGlnbm9yZU1pc3NpbmdPblJldmVydCkgeyBXcml0ZS1PdXRwdXQgXCJeXCJcIlNraXBwaW5nOiBUaGUgZmVhdHVyZSBgXCJeXCJcIiRmZWF0dXJlTmFtZWBcIl5cIlwiIGlzIG5vdCBmb3VuZC4gTm8gYWN0aW9uIHJlcXVpcmVkLlwiXlwiXCI7IEV4aXQgMDsgfTsgV3JpdGUtRXJyb3IgXCJeXCJcIkZhaWxlZCB0byByZXZlcnQgY2hhbmdlcyB0byB0aGUgZmVhdHVyZSBgXCJeXCJcIiRmZWF0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VyZU5hbWVgXCJeXCJcIjogJCgkXy5FeGNlcHRpb24uTWVzc2FnZSlcIl5cIlwiOyBFeGl0IDE7IH07IFdyaXRlLU91dHB1dCBcIl5cIlwiU3VjY2Vzc2Z1bGx5IGVuYWJsZWQgdGhlIGZlYXR1cmUgYFwiXlwiXCIkZmVhdHVyZU5hbWVgXCJeXCJcIi5cIl5cIlwiOyBFeGl0IDBcIiI=
Help
How to apply or restore "Enable security against PowerShell 2.0 downgrade attacks" using commands
- ≈ 2 min to complete
- Tools: Command Prompt
- Difficulty: Medium
- ≈ 3 instructions
- 1
Open Command Prompt
Open Command Prompt as Administrator. - 2
Copy code
Copy the code: - 3
Paste & run
Paste the commands into Command Prompt and press Enter to run.Some changes require a system restart to take effect
Similar Guides
Wider Goal
The guide below includes this guide to achieve a wider goal.See other more general settings that includes this one as one of its actions.
These plans combine multiple privacy settings, including this one, for stronger protection.
This category encompasses a range of scripts designed to improve the security of your system by enforcing security best practices. These scripts help protect your ...
Same Goal
Other guides in Security improvementsSee settings that are in the same category as this guide.
Using other actions in the same category may help you achieve your goal better.
See all 10 guides
About the Creators
These people have authored this documentation and written its scripts:
Reviewed By
This guide has undergone comprehensive auditing and peer review:Expert review by undergroundwires
- Verified technical accuracy and editorial standards
- Assessed system impact and user privacy risks
Public review by large community
- Privacy enthusiasts and professionals peer-reviewed
- Millions of end-users tested across different environments
History
We continually monitor our guides, their impact and all other privacy options. We update our guides when new information becomes available. On every update, we publicly store who made the change, what has been changed, why the change was made and when the change was made.