Powershell Command Repair-Volume Gives Invalid Property Error

Steve M 1 Reputation point
2021-12-20T19:19:18.147+00:00

When I run

PS C:\> Repair-Volume -DriveLetter C -Scan

in Powershell:

PSVersion 5.1.19041.1320
PSEdition Desktop

I get this error:

Repair-Volume : Invalid property
At line:1 char:1

  • Repair-Volume -DriveLetter C -Scan
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : MetadataError: (MSFT_Volume:ROOT/Microsoft/...age/MSFT_Volume) [Repair-
    Volume], CimException
  • FullyQualifiedErrorId : HRESULT 0x80041031,Repair-Volume

I ran sfc /scannow and found no issues.

BTW, Get-Volume throws a similar error;

Thank you.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,802 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,405 questions
0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. Steve M 1 Reputation point
    2021-12-21T14:22:57.757+00:00

    Running this as a .bat:
    Will reboot and check WMI

    @Echo off
    sc config winmgmt start= disabled
    net stop winmgmt /y
    %systemdrive%
    cd %windir%\system32\wbem
    for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
    wmiprvse /regserver
    winmgmt /regserver
    sc config winmgmt start= auto
    net start winmgmt
    for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s


  2. carlos andres bejarano asprilla 6 Reputation points
    2021-12-21T14:39:39.053+00:00

    LOOK AT THE VERSION OF THE MODULES AND CHECK IF YOU CAN EXECUTE THAT CMDLETS WITH THE CURRENT VERSION OF YOUR POWESHELL

    0 comments No comments

  3. Rich Matheisen 45,111 Reputation points
    2021-12-21T20:23:58.86+00:00

    Does this work? Get-WMIObject Win32_Volume

    How about some other WMI class? Something like $x = Get-WMIObject Win32_GroupUser