Learn how to resolve the ‘Get-NetAdapter: Invalid class’ error in PowerShell. Follow these steps to troubleshoot and fix network adapter issues on Windows systems
The error message “Get-NetAdapter: Invalid class” typically occurs when you’re trying to run the PowerShell cmdlet Get-NetAdapter
on a system where the cmdlet is not available or when it’s being used in an unsupported context. Get-NetAdapter
is used to retrieve network adapter information on Windows systems, but it’s only available on Windows 8 and later versions, as well as Windows Server 2012 and later.
Here are some steps you can take to fix this error:
- Disable and stop the WMI service
sc config winmgmt start= disabled net stop winmgmt
- Run the following commands
Winmgmt /salvagerepository %windir%\System32\wbem Winmgmt /resetrepository %windir%\System32\wbem
- Re-enable the WMI service and reboot
sc config winmgmt start= auto
If the problem remains, then try the following steps to rebuild the repository:
- Disable and stop the WMI service
sc config winmgmt start= disabled (note that there is a blank between '=' and 'disabled') net stop winmgmt
- Rename the repository folder (located at
%windir%\System32\wbem\repository
) torepository.old
- Re-enable the WMI service
sc config winmgmt start= auto
- Reboot the machine.
If the above doesn’t work try chkdsk
, sfc
, and dism
. Additionally, you can try a Windows Repair Install.