6

I have a Windows 2008 R2 SP1 server with all current windows updates. I am attempting to run PowerShell but it gives the following error:

Internal Windows PowerShell error. Loading managed Windows PowerShell failed with error 80070002

It then promptly goes back to the cmd line.

I have run a sfc /scannow and it has come back clean.

I have tried running powershell -noprofile

8

Uninstalling and reinstalling Windows Management Framework 4.0 (KB2819745) resolved the error.

6

I used this script to test all the .NET folders

@echo off
cd C:\Windows\Microsoft.NET\assembly\GAC_MSIL
for /D %%z in (*) do (
  echo %%z
  rename %%z %%z1
  powershell 'powershell works'
  rename %%z1 %%z
  pause
  echo.
)

Out of 236 folders, the only one that gave me error 80070002 was

Microsoft.PowerShell.ConsoleHost

You can repair PowerShell likes this

wusa /extract:. Windows6.1-KB2819745-x64-MultiPkg.msu
dism /online /remove-package /packagepath:Windows6.1-KB2819745-x64.cab
dism /online /add-package    /packagepath:Windows6.1-KB2819745-x64.cab

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.