question

ryanalbrecht-6441 avatar image
0 Votes"
ryanalbrecht-6441 asked Reza-Ameri answered

Install-WindowsFeature giving Error: 0x80040150

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-2019windows-server-iis
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ryanalbrecht-6441 Have you run powershell as an administrator?

0 Votes 0 ·

Make sure run the PowerShell as administrator and if problem persist, run the following command in the command prompt:

sfc /scannow

0 Votes 0 ·

1 Answer

Reza-Ameri avatar image
0 Votes"
Reza-Ameri answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.