UWF_OverlayConfig

Zeigt globale Einstellungen für das Unified Write Filter (UWF)-Overlay an und konfiguriert sie. Sie können die maximale Größe und den Typ der UWF-Überlagerung ändern.

Syntax

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

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

Member

In den folgenden Tabellen sind die Methoden und Eigenschaften aufgeführt, die zu dieser Klasse gehören.

Methoden

Methode Beschreibung
UWF_OverlayConfig.SetMaximumSize Legt die maximale Cache-Größe des Overlays in Megabyte fest.
UWF_OverlayConfig.SetType Legt den Typ der UWF-Überlagerung auf RAM-basierte oder datenträgerbasierte Fest.

Eigenschaften

Eigenschaft Datentyp Qualifizierer BESCHREIBUNG
CurrentSession Boolean [Schlüssel, lesen] Gibt an, für welche Sitzung das Objekt Einstellungen enthält.
- True für die aktuelle Sitzung
- False für die nächste Sitzung, die nach einem Neustart beginnt.
type UInt32 [read] Zeigt die Art des Overlays an.
- 0 für ein RAM-basiertes Overlay
- 1 für ein datenträgerbasiertes Overlay.
MaximumSize SInt32 [read] Gibt die maximale Cache-Größe des Overlays in Megabyte an.

Bemerkungen

Änderungen an der Überlagerungskonfiguration wirken sich auf den nächsten Neustart aus, in dem UWF aktiviert ist.

Bevor Sie die Eigenschaften "Typ" oder "MaximumSize" ändern können, muss UWF in der aktuellen Sitzung deaktiviert sein.

Beispiel

Im folgenden Beispiel wird veranschaulicht, wie Sie die maximale Größe oder den Speichertyp der Überlagerung in UWF mithilfe des WMI-Anbieters (Windows Management Instrumentation) in einem PowerShell-Skript ändern.

Das PowerShell-Skript erstellt zwei Funktionen zum Ändern der Überlagerungskonfiguration. Anschließend wird gezeigt, wie Sie die Funktion verwenden Die erste Funktion, Set-OverlaySize, legt die maximale Größe der Überlagerung fest. Die zweite Funktion, Set-OverlayType, legt den Typ der Überlagerung auf RAM-basierte oder datenträgerbasierte Fest.

$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

Anforderungen

Windows-Edition Unterstützt
Windows Home Nein
Windows Pro Nein
Windows Enterprise Ja
Windows Education Ja
Windows IoT Enterprise Ja

WMI-Anbieterreferenz für den vereinheitlichten Schreibfilter

Einheitlicher Schreibfilter