LOOK AT THE VERSION OF THE MODULES AND CHECK IF YOU CAN EXECUTE THAT CMDLETS WITH THE CURRENT VERSION OF YOUR POWESHELL
Powershell Command Repair-Volume Gives Invalid Property Error
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 for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
4 answers
Sort by: Most helpful
-
carlos andres bejarano asprilla 11 Reputation points
2021-12-21T14:39:39.053+00:00 -
MotoX80 36,401 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. } }
-
Rich Matheisen 47,901 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
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more