UWF_OverlayConfig

통합 쓰기 필터(UWF) 오버레이에 대한 전역 설정을 표시하고 구성합니다. UWF 오버레이의 최대 크기와 형식을 수정할 수 있습니다.

구문

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

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

구성원

다음 표에는 이 클래스에 속하는 메서드 및 속성이 나와 있습니다.

메서드

메서드 설명
UWF_OverlayConfig.SetMaximumSize 오버레이의 최대 캐시 크기(메가바이트)를 설정합니다.
UWF_OverlayConfig.SetType UWF 오버레이의 형식을 RAM 기반 또는 디스크 기반으로 설정합니다.

속성

속성 데이터 형식 한정자 Description
CurrentSession Boolean [key, read] 개체에 어떤 세션의 설정이 포함되어 있는지를 나타냅니다.
- True이면 다시 시작한 후 시작되는 다음 세션
- 의 현재 세션 False입니다.
형식 UInt32 [읽기] 오버레이의 형식을 나타냅니다.
- 디스크 기반 오버레이의 경우 RAM 기반 오버레이
- 1의 경우 0입니다.
MaximumSize SInt32 [읽기] 오버레이의 최대 캐시 크기(메가바이트)를 나타냅니다.

설명

오버레이 구성에 대한 변경 내용은 UWF를 사용하도록 설정한 후 다시 시작하면 적용됩니다.

Type 또는 MaximumSize 속성을 변경하려면 먼저 현재 세션에서 UWF를 사용하지 않도록 설정해야 합니다.

예제

다음 예제에서는 PowerShell 스크립트에서 WMI(Windows Management Instrumentation) 공급자를 사용하여 UWF에서 오버레이의 최대 크기나 스토리지 유형을 변경하는 방법을 보여 줍니다.

PowerShell 스크립트는 오버레이 구성을 수정하는 두 개의 함수를 만듭니다. 그런 다음 함수를 사용하는 방법을 보여 줍니다. 첫 번째 함수인 Set-OverlaySize는 오버레이의 최대 크기를 설정합니다. 두 번째 함수인 Set-OverlayType은 오버레이 유형을 RAM 기반 또는 디스크 기반으로 설정합니다.

$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

요구 사항

Windows 버전 지원됨
Windows Home No
Windows Pro No
Windows Enterprise Yes
Windows Education Yes
Windows IoT Enterprise

통합 쓰기 필터 WMI 공급자 참조

통합 쓰기 필터