Glam Prestige Journal

Bright entertainment trends with youth appeal.

Using Windows 10 Pro Version 1909 (Build 18363.476), when I try to run in Powershell (Administrator):Get-Module -ListAvailable -All

I get an access denied to location "C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\BitLocker\BitLocker.psm1" error, so it looks like my PowerShell installation is corrupt.

How can I repair/reinstall it?

11

3 Answers

While there is no offical way to repair PowerShell in Windows 10, here is how I did it:

  • I just downloaded a VM image of Windows 10,
  • zipped C:\WINDOWS\system32\WindowsPowerShell\v1.0
  • saved permissions of the v1.0 folder into a file using icacls
  • extracted the zip on the machine with the broken powershell
  • restored file permissions with icacls

Now it works again.

1

PowerShell is an integral part of Windows 10 and cannot be uninstalled.

What can be done is:

  • Download .NET Frameworkand re-install the latest version.
    (Note: Reinstalling .Net is inconsistent. Windows will not agree to reinstall a version over itself, only over an older version. In some cases there will be an option to uninstall the latest .Net version and return to to an earlier version, but not in most cases.)

  • Reset all Windows components to a known state by an offline In-place Upgrade, by "upgrading" Windows to itself (or to the latest version). This is equivalent to a major Windows update so take the same precautions. See the article
    Repair Install of Windows 10 with an In-place Upgrade.

7

As an attempt to repair, you can disable and re-enable Windows PowerShell. See this post on Microsoft's forums. (Edit: Per Ramhound's comments, note that this is (at best) unlikely to help. This does not uninstall or entirely disable all versions of Windows PowerShell)

If that doesn't work, you can attempt to repair/reset/resinstall Windows. Note that your files and installed software will be affected by these options.

However (since you just said "PowerShell" and not explicitly "Windows PowerShell"), depending on your situation, you may wish instead to abandon Windows PowerShell and switch to PowerShell Core. (If so, you'll likely want to disable Windows Powershell) This may be preferable to resinstalling/resetting Windows, and this is actually Microsoft's prescribed solution for those who want the newer versions of PowerShell available; see this Microsoft docs page.

Here is Microsoft's page on installing PowerShell Core. Here is a 3rd party guide, written in 2019.

6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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