Microsoft no longer supports PowerShell version 2.0. It will continue to work, but it won’t get patched. Instead, Microsoft wants organizations to shift to PowerShell 5.0, or newer versions. The rationale is that Windows PowerShell 2.0 lacks security protections that have been built into later versions, particularly PowerShell 5.0.
It’s possible for attackers to invoke Windows PowerShell 2.0 if it’s installed in a computing environment. Attackers could use that approach to cover their tracks since Windows PowerShell 2.0 lacks logging capabilities. One solution is to just turn off Windows PowerShell 2.0.
If you are using Windows 10, or Windows Server 2016, you should already have Windows PowerShell 5.1.
If you have only PowerShell 2.0 (or prior version to 5) on your computer, download PowerShell v5 from: https://www.microsoft.com/en-us/download/details.aspx?id=54616.
In case you have both PowerShell v2 (or v3) and PowerShell v5 then you need to uninstall any version prior 5:
Click on “Control Panel” in “Start menu”
Go to “Uninstall a program” in “Control Panel”
Click on “View installed updates” in “Programs and Features”
Right click on Update which reads PowerShell and uninstall it
Windows 10 / 11:
Open the “Control Panel”, and click on the “Programs and Features” icon
Click on the “Turn Windows features on or off” link on the left side
Uncheck the “Windows PowerShell 2.0” box for what you want, and click on OK
Click on Close when it has finished
Note: for Windows 10 you can use PowerShell command (run PowerShell as Admin) and type:
Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root