PowerShell Logo Small

Optimize-Volume



This is the built-in help made by Microsoft for the command 'Optimize-Volume', in PowerShell version 4 - as retrieved from Windows version 'Microsoft Windows 8.1 Enterprise' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Optimizes a volume.

SYNTAX


Optimize-Volume [-DriveLetter] <Char[]> [-Analyze] [-AsJob] [-CimSession <CimSession[]>] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32>] [-TierOptimiz
e] [-Confirm] [-WhatIf] [<CommonParameters>]
Optimize-Volume [-Analyze] [-AsJob] [-CimSession <CimSession[]>] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32>] [-TierOptimize] -Path <String[]> [-Co
nfirm] [-WhatIf] [<CommonParameters>]
Optimize-Volume [-Analyze] [-AsJob] [-CimSession <CimSession[]>] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32>] [-TierOptimize] -ObjectId <String[]>
[-Confirm] [-WhatIf] [<CommonParameters>]
Optimize-Volume [-Analyze] [-AsJob] [-CimSession <CimSession[]>] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32>] [-TierOptimize] -InputObject <CimInst
ance[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Optimize-Volume [-Analyze] [-AsJob] [-CimSession <CimSession[]>] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32>] [-TierOptimize] -FileSystemLabel <Str
ing[]> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Optimize-Volume cmdlet optimizes a volume, performing such tasks on supported volumes and system SKUs as defragmentation, trim, slab consolidation, and storage ti
er processing.



If no parameter is specified, then the default operation will be performed per the drive type as follows.


-- HDD, Fixed VHD, Storage Space. -Analyze -Defrag.
-- Tiered Storage Space. -TierOptimize.
-- SSD with TRIM support. -Retrim.
-- Storage Space (Thinly provisioned), SAN Virtual Disk (Thinly provisioned), Dynamic VHD, Differencing VHD. -Analyze -SlabConsolidate -Retrim.
-- SSD without TRIM support, Removable FAT, Unknown. No operation.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=307010
Format-Volume
Get-Volume
Repair-Volume
Set-Volume

REMARKS

<

Examples


Example 1: Perform TRIM optimization

PS C:\>Optimize-Volume -DriveLetter H -ReTrim –Verbose



This example optimizes drive H by re-sending Trim requests. This is useful on SSD media, and thinly provisioned storage.




Example 2: Analyze a volume

PS C:\>Optimize-Volume -DriveLetter H -Analyze –Verbose



This example reports only the current optimization state of drive H.




Example 3: Defragment a volume

PS C:\>Optimize-Volume -DriveLetter H -Defrag –Verbose



This example defragments drive H.




Example 4: Perform slab consolidation

PS C:\>Optimize-Volume -DriveLetter H -SlabConsolidate –Verbose



This example performs slab consolidation on the storage space backing volume H.




Example 5: Tier optimize a volume

PS C:\>Optimize-Volume -DriveLetter H -TierOptimize



This example performs tier optimization on the tiered storage space backing volume H.