Partilhar via


UWF_OverlayConfig

Apresenta e configura as definições globais para a sobreposição do Filtro de Escrita Unificado (UWF). Pode modificar o tamanho máximo e o tipo de sobreposição UWF.

Sintaxe

class UWF_OverlayConfig{
    [key, Read] boolean CurrentSession;
    [read] UInt32 Type;
    [read] SInt32 MaximumSize;

    UInt32 SetType(
        UInt32 type
    );
    UInt32 SetMaximumSize(
        UInt32 size
    );
};

Membros

As tabelas seguintes listam os métodos e propriedades que pertencem a esta classe.

Métodos

Método Descrição
UWF_OverlayConfig.SetMaximumSize Define o tamanho máximo da cache, em megabytes, da sobreposição.
UWF_OverlayConfig.SetType Define o tipo de sobreposição UWF para baseado em RAM ou baseado em disco.

Propriedades

Propriedade Tipo de dados Qualificadores Descrição
CurrentSession Booliano [chave, leitura] Indica para que sessão o objeto contém definições.
- Verdadeiro para a sessão
- atual Falso para a próxima sessão que começa após um reinício.
Tipo UInt32 [ler] Indica o tipo de sobreposição.
- 0 para uma sobreposição
- baseada em RAM1 para uma sobreposição baseada em disco.
Tamanho Máximo SInt32 [ler] Indica o tamanho máximo da cache, em megabytes, da sobreposição.

Comentários

As alterações à configuração de sobreposição produzem efeitos no próximo reinício no qual o UWF está ativado.

Antes de poder alterar as propriedades Tipo ou Tamanho Máximo , o UWF tem de ser desativado na sessão atual.

Exemplo

O exemplo seguinte demonstra como alterar o tamanho máximo ou o tipo de armazenamento da sobreposição na UWF com o fornecedor do Windows Management Instrumentation (WMI) num script do PowerShell.

O script do PowerShell cria duas funções para modificar a configuração de sobreposição. Em seguida, demonstra como utilizar as funções. A primeira função, Set-OverlaySize, define o tamanho máximo da sobreposição. A segunda função, Set-OverlayType, define o tipo da sobreposição como baseada em RAM ou baseada em disco.

$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"

# Define common parameters

$CommonParams = @{"namespace"=$NAMESPACE; "computer"=$COMPUTER}

function Set-OverlaySize([UInt32] $size) {

# This function sets the size of the overlay to which file and registry changes are redirected
# Changes take effect after the next restart

# $size is the maximum size in MB of the overlay

# Make sure that UWF is currently disabled

    $UWFFilter = Get-WmiObject -class UWF_Filter @commonParams

    if ($UWFFilter.CurrentEnabled -eq $false) {

# Get the configuration for the next session after a restart

        $nextConfig = Get-WMIObject -class UWF_OverlayConfig -Filter "CurrentSession = false" @CommonParams;

        if ($nextConfig) {

# Set the maximum size of the overlay

        $nextConfig.SetMaximumSize($size);
            write-host "Set overlay max size to $size MB."
        }
    } else {
        write-host "UWF must be disabled in the current session before you can change the overlay size."
    }
}

function Set-OverlayType([UInt32] $overlayType) {

# This function sets the type of the overlay to which file and registry changes are redirected
# Changes take effect after the next restart

# $overlayType is the type of storage that UWF uses to maintain the overlay. 0 = RAM-based; 1 = disk-based.

    $overlayTypeText = @("RAM-based", "disk-based")

# Make sure that the overlay type is a valid value

    if ($overlayType -eq 0 -or $overlayType -eq 1) {

# Make sure that UWF is currently disabled

        $UWFFilter = Get-WmiObject -class UWF_Filter @commonParams

        if ($UWFFilter.CurrentEnabled -eq $false) {

# Get the configuration for the next session after a restart

            $nextConfig = Get-WMIObject -class UWF_OverlayConfig -Filter "CurrentSession = false" @CommonParams;

            if ($nextConfig) {

# Set the type of the overlay

        $nextConfig.SetType($overlayType);
                write-host "Set overlay type to $overlayTypeText[$overlayType]."
            }
        } else {
            write-host "UWF must be disabled in the current session before you can change the overlay type."
        }
    } else {
        write-host "Invalid value for overlay type.  Valid values are 0 (RAM-based) or 1 (disk-based)."
    }
}

# The following sample commands demonstrate how to use the functions to change the overlay configuration

$RAMMode = 0
$DiskMode = 1

Set-OverlaySize 2048

Set-OverlayType $DiskMode

Requisitos

Edição do Windows Com suporte
Windows Home Não
Windows Pro Não
Windows Enterprise Sim
Windows Education Sim
Windows IoT Enterprise Sim

Referência do fornecedor WMI de Filtro de Escrita Unificado

Filtro de Escrita Unificado