Closed jgwinner closed 2 years ago
This is why MS is going down :( the basics don't work and no one pays attention because "Triage".
Thanks again for contacting Microsoft. I went through the documentation outlined and was unable to reproduce the error "Get-WindowsCapability: Class not registered". This was tested on Windows 10 Pro 21H1 & Windows 11 22H2 in a VM and non-VM environment.
PowerShell 5.1
PowerShell 7.2
The Get-WindowsCapability command belongs to the DISM module. A list of associated DISM commands can be found by running: Import-module DISM -Verbose
The error encountered, "Class not registered", can be a software or hardware issue where the hard drive may potentially be unhealthy, or the OS is missing specific dll files or even corrupted. Generally, the following can be ran in the Windows Command Prompt to check for OS corruption:
1] DISM /Online /Cleanup-Image /ScanHealth (wait for this to complete). 2] DISM /Online /Cleanup-Image /RestoreHealth (once complete, reboot). 3] Once back in the command prompt, run: sfc /scannow.
There are several potential fixes to this issue depending on what is causing it. If you Google or Bing "Get-WindowsCapability: Class not registered error" you will find different remedies to this issue.
Thank you.
THIS IS NOT A HARD DRIVE PROBLEM.
This is a "different versions of Windows have different base DLL's". It's well documented that this error occurs.
MS can't even fix their own O/S
The step in the article to install OpenSSH does not work on Windows 10 or Windows 11.
I don't use PowerShell much, as I use TCC's replacement shell, so maybe there's some component that it needs, that isn't installed and not checked for.
My current Win10 particulars:
If I run an older powershell, it does work, however.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.