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