Compartilhar via


Optimize-Volume

Optimize-Volume

Optimizes a volume.

Sintaxe

Parameter Set: ByDriveLetter
Optimize-Volume [-DriveLetter] <Char[]> [-Analyze] [-AsJob] [-CimSession <CimSession[]> ] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32> ] [-TierOptimize] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ById
Optimize-Volume -ObjectId <String[]> [-Analyze] [-AsJob] [-CimSession <CimSession[]> ] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32> ] [-TierOptimize] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByLabel
Optimize-Volume -FileSystemLabel <String[]> [-Analyze] [-AsJob] [-CimSession <CimSession[]> ] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32> ] [-TierOptimize] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByPaths
Optimize-Volume -Path <String[]> [-Analyze] [-AsJob] [-CimSession <CimSession[]> ] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32> ] [-TierOptimize] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: InputObject (cdxml)
Optimize-Volume -InputObject <CimInstance[]> [-Analyze] [-AsJob] [-CimSession <CimSession[]> ] [-Defrag] [-ReTrim] [-SlabConsolidate] [-ThrottleLimit <Int32> ] [-TierOptimize] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descrição detalhada

The Optimize-Volume cmdlet optimizes a volume, performing such tasks on supported volumes and system SKUs as defragmentation, trim, slab consolidation, and storage tier 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.

Parâmetros

-Analyze

Analyzes the volume specified for fragmentation statistics. Performs analysis only and reports the current optimization state of the volume.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-AsJob

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-CimSession<CimSession[]>

Executa o cmdlet em uma sessão remota ou em um computador remoto. Insira um nome do computador ou um objeto de sessão, como a saída de um cmdlet New-CimSession ou Get-CimSession. O padrão é a sessão atual do computador local.

Aliases

Session

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-Defrag

Indicates that the cmdlet initiates defragmentation on the specified volume. Defragmentation consolidates fragmented regions of files to improve performance of sequential reads or writes.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-DriveLetter<Char[]>

Specifies the drive letter of the volume to optimize.

Aliases

nenhuma

Necessário?

true

Posição?

1

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-FileSystemLabel<String[]>

Specifies the file system label of the volume to optimize.

Aliases

nenhuma

Necessário?

true

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-InputObject<CimInstance[]>

Accepts a volume object from the pipeline as input.

Aliases

nenhuma

Necessário?

true

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByValue)

Aceitar caracteres curinga?

false

-ObjectId<String[]>

Specifies the ID of the volume to optimize.

Aliases

Id

Necessário?

true

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-Path<String[]>

Specifies the path of the volume to optimize.

Aliases

nenhuma

Necessário?

true

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-ReTrim

Generates TRIM and Unmap hints for all currently unused sectors of the volume, notifying the underlying storage that the sectors are no longer needed and can be purged. This can recover unused capacity on thinly provisioned drives.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-SlabConsolidate

Indicates that the cmdlet performs slab consolidation on the storage to optimize slab allocations and to reduce the number of used slabs.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-ThrottleLimit<Int32>

Especifica o número máximo de operações simultâneas que podem ser estabelecidas para executar o cmdlet. Se esse parâmetro for omitido ou um valor de 0 for inserido, o Windows PowerShell® calculará o limite ideal de restrição para o cmdlet com base no número de cmdlets do CIM que estão em execução no computador. O limite de restrição se aplica somente ao cmdlet atual, e não à sessão ou ao computador.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-TierOptimize

Indicates that the cmdlet performs tier optimization of the volume, which places file data on the optimal storage tier according to heat or desired placement. This parameter only applies to tiered spaces volumes with more than one storage tier.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-Confirm

Solicita que você confirme antes de executar o cmdlet.

Necessário?

false

Posição?

named

Valor padrão

false

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-WhatIf

Mostra o que aconteceria se o cmdlet fosse executado. O cmdlet não é executado.

Necessário?

false

Posição?

named

Valor padrão

false

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

<CommonParameters>

Esse cmdlet dá suporte a parâmetros comuns: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer e -OutVariable. Para obter mais informações, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

O tipo de entrada é o tipo dos objetos que você pode canalizar para o cmdlet.

Saídas

O tipo de saída é o tipo de objeto emitido pelo cmdlet.

  • This cmdlet does not generate output.

Observações

  • O objeto Microsoft.Management.Infrastructure.CimInstance é uma classe wrapper que exibe objetos da WMI (Instrumentação de Gerenciamento do Windows). O caminho após o sinal de cerquilha (#) indica o namespace e o nome de classe do objeto subjacente da WMI.

Exemplos

Example 1: Perform TRIM optimization

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

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

Example 2: Analyze a volume

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

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

Example 3: Defragment a volume

This example defragments drive H.

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

Example 4: Perform slab consolidation

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

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

Example 5: Tier optimize a volume

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

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

Tópicos relacionados

Format-Volume

Get-Volume

Repair-Volume

Set-Volume