Windows – Is it in any way possible to uninstall PowerShell from Vista

command linepowershelluninstallwindows-vista

Is it in any way possible to uninstall PowerShell from Windows Vista?

  • There is no Uninstall option under Start/All Programs.
  • It's start menu group is actually located under Accessories which is
    hard to find at first.
  • There is no uninstaller.
  • It doesn't show up in the Add/Remove program list (Programs and Features).
  • It's actually hidden in the Installed Updates window.
  • It's not listed as "PowerShell" in the Installed Updates window. It's actually named "Management Framework Core".

Why I need to remove it

The reason I need to remove it is because the Windows Vista setup program requires that I remove PowerShell before I can do a repair install of Windows.

(Click on image for larger view.)

small1
small2

small3
small4

What I have done so far

Uninstalling KB968930 a.k.a. Management Framework Core a.k.a. PowerShell

I obviously tried uninstalling it from the Programs and Features window in Control Panel. But it's actually only accessible as an update from Installed Update window.

  1. Control Panel
  2. Programs (or "Uninstall a program")
  3. Programs and Features
  4. Click on "View installed updates" link on the left.
  5. Type in "KB968930" in the Search field.
  6. Select "Windows Management Framework Core (KB968930)" from search results.
  7. Click Uninstall button.
  8. "Are you sure you want to uninstall this update?" Click Yes.
  9. "Please wait while the updates are being uninstalled. This might take several minutes."
  10. "An error has occurred. Not all of the updates were successfully uninstalled."

small1
small2

small3
small4

This did not resolve the issue.

Registry change, taking ownership and renaming of folder

Next, I tried changing the following registry key.

FROM THIS:

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1
Value: Install
Type: Reg_Dword
Data: 0

TO THIS:

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1
Value: Install
Type: Reg_Dword
Data: 1

Then I started elevated cmd prompt and I used it to take ownership of the PowerShell directory.

C:\Windows\system32>takeown /f %windir%\system32\windowspowershell

SUCCESS: The file (or folder): "C:\Windows\system32\windowspowershell" now owned
 by user "computername\username".

C:\Windows\system32>cacls %windir%\system32\windowspowershell /G administrators:
F
No mapping between account names and security IDs was done.

C:\Windows\system32>icacls %windir%\system32\windowspowershell /G administrators
:F
Invalid parameter "/G"

C:\Windows\system32>cacls %windir%\system32\windowspowershell /G administrators:
F
No mapping between account names and security IDs was done.

C:\Windows\system32>icacls %windir%\system32\windowspowershell /grant administra
tors:F
administrators: No mapping between account names and security IDs was done.
Successfully processed 0 files; Failed processing 1 files

C:\Windows\system32>

I wasn't sure whether I should use the cacls or icacls command and I wasn't sure of the syntax (any input on that?). But anyway! I was now the owner of the directory and I was able to rename it.

  1. Win+R
  2. C:\Windows\System32\
  3. Renamed "WindowsPowerShell" to "WindowsPowerShellOld"

So the path is now C:\Windows\System32\WindowsPowerShellOld. PowerShell is now "somewhat" disabled i.e. shortcuts on Start menu don't work now and running powershell.exe directly from C:\Windows\System32\WindowsPowerShellOld\v1.0 shows a cmd like command prompt with black background and several red error lines that say "file not found".

small

But the main problem is still not solved. I still can't do repair install of Windows. Setup program still reports that PowerShell is installed.

So…. any clever ideas? What else can I do?

The only thing that remains now is to do a clean install of Windows.

Best Answer

Solved!

Don't forget to rename the PowerShell folder in the 64-bit folder! I think that did the trick.

  1. Win+R
  2. C:\Windows\System32
  3. Enter
  4. Rename "WindowsPowerShell" to "WindowsPowerShellOld".
  5. Win+R
  6. C:\Windows\SysWOW64
  7. Enter
  8. Rename "WindowsPowerShell" to "WindowsPowerShellOld".

If you get any UAC prompts just click to confirm or provide a password if needed, and click on Continue if you get any warning about performing these operations.

You should definitely try uninstalling KB968930 first (as noted above) and see if that works. If you encounter any errors uninstalling this like I did or if the Windows setup program still says you need to uninstall PowerShell to continue even after you have removed KB968930 then try renaming these folders.

I would suggest that you skip the registry trick at first, and that you skip taking ownership of these folders. Just go straight to the folders in Windows Explorer and try renaming them as noted above. If you are unable to rename them, go ahead and make the registry change (as noted above) and also take ownership of these folders.

Alternatively, you can rename the folders as "WindowsPowerShell2". I don't know if this has any effect on it. It really should not. This is actually the bogus name I used last time. But I think the really important thing is to rename the folder inside C:\Windows\SysWOW64.