Install-WindowsFeature giving Error: 0x80040150

ryan albrecht 1 Reputation point
2021-04-12T18:43:32.097+00:00

Hi,

I am trying to install the Web-WebSocket feature using powershell put I am getting an error

PS C:\Windows\system32> Install-WindowsFeature -Name Web-WebSockets
Install-WindowsFeature : An unexpected error has occurred. Could not read key from registry Error: 0x80040150
At line:1 char:1

  • Install-WindowsFeature -Name Web-WebSockets
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidResult: (@{Vhd=; Credent...Name=localhost}:PSObject) [Install-WindowsFeature], Exception
  • FullyQualifiedErrorId : RegistryKey_OpenSubKey_Failed,Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureCommand

I cannot seem to find any solutions online.

Regards
Ryan

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
4,109 questions
Internet Information Services
{count} votes

1 answer

Sort by: Most helpful
  1. Reza-Ameri 17,331 Reputation points Volunteer Moderator
    2021-06-24T14:41:17.613+00:00

    The error code 0x80040150 indicate cannot read from the registry and normally it is the permission issue.
    Try run the PowerShell as administrator.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.