UWF_OverlayConfig (Standard 8)

7/8/2014

Review the syntax, members, and examples of the UWF_OverlayConfig WMI provider class for Windows Embedded 8 Standard (Standard 8).

This class displays and configures global settings for the Unified Write Filter (UWF) overlay. You can modify the maximum size and the type of the UWF overlay.

Syntax

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

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

Members

The following tables list the methods and properties that belong to this class.

Methods

Method

Description

SetMaximumSize

Sets the maximum cache size, in MB, of the overlay.

SetType

Sets the type of the UWF overlay to either RAM-based or disk-based.

Properties

Property

Data type

Qualifiers

Description

CurrentSession

boolean

[key, read]

True: Indicates that this object contains settings for the current session.

False: Indicates that this object contains settings for the next session that begins after a restart.

Type

UInt32

[read]

Indicates the type of overlay.

0: RAM-based overlay

1: disk-based overlay

MaximumSize

SInt32

[read]

Indicates the maximum cache size, in MB, of the overlay.

Remarks

Changes to the overlay configuration take effect on the next restart in which UWF is enabled.

Before you can change the Type or MaximumSize properties, UWF must be disabled in the current session.

Example

The following example demonstrates how to change the maximum size or the storage type of the overlay in UWF by using the Windows Management Instrumentation (WMI) provider in a PowerShell script.

The PowerShell script creates two functions to modify the overlay configuration. It then demonstrates how to use the functions. The first function, Set-OverlaySize, sets the maximum size of the overlay. The second function, Set-OverlayType, sets the type of the overlay to RAM-based or disk-based.

$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

Requirements

Architecture

x64,
x86

MOF

uwfwmi.mof

WMI Namespace

root\standardcimv2\embedded

WMI Provider

UWF

See Also

Reference

Unified Write Filter WMI Provider Reference

Concepts

Unified Write Filter (UWF) Overview