Quickie: PowerShell "Get-PartitionSupportedSize" command fails when DefragSvc is disabled

The PowerShell "Get-PartitionSupportedSize" command and the GetSupportedSize method of the MSFT_Partition WMI class may fail if the "Optimize drives" (defragsvc) service is set to disabled.  The default is the service is set to "manual" start. 


Fix this with the command

Set-Service -Name defragsvc -StartupType Manual


Comments