Powershell preventing Server 2003 to 2008 upgrade

Powershell preventing Server 2003 to 2008 upgrade

I came to upgrade one of our servers from Windows Server 2003 to 2008 today. Unfortunately, the upgrade failed in the first stages because the compatibility checker declared Windows Powershell 1.0 incompatible with Server 2008, and told me to uninstall it before upgrading.

Easier said than done, because there’s no uninstaller.

Well, of course there is an uninstaller, but it’s not in Add/Remove Programs where you’d expect it. Even if you show updates.

Of course, many uninstallers are kept on the machine in the c:\windows\ folder, in cryptic $NTUninstallKBxxxxxx$ folders which relate to the update Knowledgebase number. Naturally, you have no idea which of these is the correct one and nothing in the many folders gives away the contents. You could search the internet for each and every number, but that’ll take forever.

Thankfully, there’s an easier way – use the registry.

Navigate to HKLM\Software\Microsoft\Updates\Windows PowerShell 1.0\, and there you’ll find some keys relating to the SP level of Powershell you have installed. In my case, it was SP2. There’ll be a key called “UninstallCommand”, the value of which is the full path to the uninstaller exe. For me, this was C:\WINDOWS\$NtUninstallKB926139-v2$\spuninst\spuninst.exe, and running that uninstalled Powershell. If you’ve SP1 or SP3 rather than SP2 then yours will be in a different location, but is still referred to in UninstallCommand.

I also had a Windows Powershell 1.0 MUI set of keys in HKLM\Software\Microsoft\Updates, again with an UninstallCommand – this time pointing to C:\WINDOWS\$NtUninstallKB926141$\spuninst\spuninst.exe. I ran that just in case too.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.