Hi,
I checked my Windows Server 2022 machine and the MicrosoftWindowsPowerShellV2 feature is enabled by default. To make sure the PowerShell 2 is disabled, you may consider running powershell.exe -version 2 and check the exit code $LASTEXITCODE.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello all,
we have recently installed 3 new DCs on windows server 2k22 Datacenter Edition and we will decomission 3 old ones that run on windows server 2k19 Datacenter Edition. On all of our servers,the powershell version 2 engine is uninstalled. I am not the one that deploys the new servers but i think that with the 2k22 version the powershell v2 is by default uninstalled and with the older 2k19 you had to do it by yourself? That is not important at the moment.
when i run the command "get-windowsoptionalfeature -online -featurename MicrosoftWindowsPowershellV2" on the 2k19 Server , i get the result state : disabled. And as i am trying to prove it by falling back to the v2 , it doesn't work. So far so good. That would be the expecting behavior.
But when i am doing the same thing on the 2k22 host, the results are different:
On both cases the fallback to v2 fails. That is good and it is not posing a security threat. But why is it shown as enabled on the 2k22 Server? even though it is not?
What would be the best and the "official" way to test that Powershell v2 engine is uninstalled in our environment?
It looks like the old ways to do that produce inconclusive results and i am looking ofc for a solution that could be automated (scripted).
Thank you in advance for your time and thoughts.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.
Hi,
I checked my Windows Server 2022 machine and the MicrosoftWindowsPowerShellV2 feature is enabled by default. To make sure the PowerShell 2 is disabled, you may consider running powershell.exe -version 2 and check the exit code $LASTEXITCODE.