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 ベースまたはディスク ベースに設定します。

Properties

プロパティ データ型 修飾子 説明
CurrentSession Boolean [key, read] オブジェクトに設定が含まれているセッションを示します。
- 再起動後に開始される次のセッション
- の現在のセッション False の場合は True。
Type UInt32 [read] オーバーレイの種類を示します。
- RAM ベースのオーバーレイ
- の場合は 0。ディスク ベースのオーバーレイの場合は1
MaximumSize SInt32 [read] オーバーレイの最大キャッシュ サイズをメガバイト単位で示します。

注釈

オーバーレイ構成の変更は、UWF が有効になっている次回の再起動時に有効になります。

Type プロパティまたは MaximumSize プロパティを変更する前に、現在のセッションで UWF を無効にする必要があります。

次の例では、PowerShell スクリプトで Windows Management Instrumentation (WMI) プロバイダーを使用して、UWF のオーバーレイの最大サイズまたは記憶域の種類を変更する方法を示します。

PowerShell スクリプトでは、オーバーレイ構成を変更する 2 つの関数を作成します。 さらにそれは、各関数を使用する方法を示します。 最初の関数 Set-OverlaySize は、オーバーレイの最大サイズを設定します。 2 番目の関数 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 ホーム いいえ
Windows Pro いいえ
Windows Enterprise はい
Windows Education はい
Windows IoT Enterprise はい

統合書き込みフィルター処理 WMI プロバイダー リファレンス

統合書き込みフィルター