Optimize Storage In Windows To Optimize the Storage in Windows Server 2012, 2012 R2, 2016 and 2019 Windows PowerShell cmdlet is available. It provides the ability to manually perform actions like TRIM, Defragment, etc. TRIM – The parameter is ReTrim which generates TRIM and Unmap hints for all currently unused sectors of a volume. Defrag – The parameter defrag/L performs the same TRIM (-ReTrim) as the Optimize-Storage PowerShell cmdlet