The parameter DriveLetter must be an array of CHARACTERS. You don't have a drive letter ":".
To fix your problem, remove the ":".
Syntax
Optimize-Volume [-DriveLetter] <Char[]>
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When I run drive optimization from the Tools menu of Windows Explorer, it completes almost instantly, but then it still shows Needs Optimization. If I run it from PowerShell in Verbose mode, it shows a CimException as displayed below. Please advise.
Optimize-Volume -DriveLetter F: -ReTrim -Verbose
Optimize-Volume : No MSFT_Volume objects found with property 'DriveLetter' equal to ':'.
Verify the value of the property and retry.
At line:1 char:1
+ Optimize-Volume -DriveLetter F: -ReTrim -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (::Char) [Optimize-Volume], CimJobException
+ FullyQualifiedErrorId : CmdletizationQuery_NotFound_DriveLetter,Optimize-Volume
VERBOSE: Invoking retrim on T7 (F:)...
VERBOSE: Retrim: 0% complete...
VERBOSE: Retrim: 100% complete.
Optimize-Volume : Failed
Activity ID: {d7be6109-3c6e-0006-0f65-bed76e3cda01}
At line:1 char:1
+ Optimize-Volume -DriveLetter F: -ReTrim -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (StorageWMI:ROOT/Microsoft/...age/MSFT_Volume) [Optimize-Volume], CimException
+ FullyQualifiedErrorId : StorageWMI 4,Optimize-Volume
The parameter DriveLetter must be an array of CHARACTERS. You don't have a drive letter ":".
To fix your problem, remove the ":".
Syntax
Optimize-Volume [-DriveLetter] <Char[]>
Hi Roel Vlemmings,
It seems the Optimize-Volume cmdlet has finished resending the TRIM requests. Please manually restart the optimize drives service (defragsvc) and see if the issue persists.
Also run defrag.exe c: /retrim
to see if the operation can be completed normally.
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.