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,706 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,389 questions
0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. MotoX80 32,076 Reputation points
    2021-12-20T21:51:34.6+00:00

    BTW, Get-Volume throws a similar error;

    Were you messing with the code page or something? Does this script produce the same results that I get?

    cls  
    "C" | format-hex  
    ""  
    (Get-Volume -DriveLetter C).FileSystem  
    ""  
    $vols = get-volume    
    ForEach ($vol in $vols) {      
        if (($vol.DriveLetter.ToString().Length  -ne 0) -and ($vol.DriveType -eq "Fixed")) {  
            "Checking drive {0}" -f $vol.driveletter  
            $vol.driveletter.ToString() | format-hex  
            Repair-Volume -DriveLetter $vol.driveletter -Scan  
            return    # the first drive we find should be the C drive. Stop after that. Delete this line to scan all.    
        }       
    }  
      
    

    159096-capture.jpg

    0 comments No comments

  2. Steve M 1 Reputation point
    2021-12-21T03:25:29.75+00:00

    Hi @MotoX80 ,
    I did not do anything with any Powershell code.
    I was attempting to scan my C: drive when I got the error.

    I can't run the code you posted because I get the same error.

    Get-Volume : Invalid property
    At line:1 char:3

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

    Thanks,
    Steve


  3. Steve M 1 Reputation point
    2021-12-21T14:01:48.973+00:00

    Here is what I get when I type get-volume:

    PS C:\WINDOWS\system32> get-volume
    get-volume : Invalid property
    At line:1 char:1

    • get-volume
    • ~~~~~~~~~~
    • CategoryInfo : MetadataError: (MSFT_Volume:ROOT/Microsoft/...age/MSFT_
      Volume) [Get-Volume], CimException
    • FullyQualifiedErrorId : HRESULT 0x80041031,Get-Volume

    Do you want me to post what I get when I run your script?
    Thanks

    0 comments No comments

  4. Steve M 1 Reputation point
    2021-12-21T14:04:41.14+00:00

    This is the output from your script:

           00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
    

    00000000 43 C

    Get-Volume : Invalid property
    At line:4 char:3

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

    get-volume : Invalid property
    At line:6 char:10

    • $vols = get-volume
    • ~~~~~~~~~~
    • CategoryInfo : MetadataError: (MSFT_Volume:ROOT/Microsoft/...age/MSFT_Volume) [Get-Vol
      ume], CimException
    • FullyQualifiedErrorId : HRESULT 0x80041031,Get-Volume

  5. Steve M 1 Reputation point
    2021-12-21T14:13:59.597+00:00

    Here is the output from Diskpart:

    PS C:\WINDOWS\system32> diskpart

    Microsoft DiskPart version 10.0.19041.964

    Copyright (C) Microsoft Corporation.
    On computer: DESKTOP-T3GFTCQ