UWF_覆盖UWF_Overlay

包含在统一写入筛选器 (UWF) 覆盖区上的当前大小和管理的覆盖层大小的严重和警告阈值。Contains the current size of the Unified Write Filter (UWF) overlay and manages the critical and warning thresholds for the overlay size.

语法Syntax

class UWF_Overlay {
    [key]  string Id;
    [read] UInt32 OverlayConsumption;
    [read] UInt32 AvailableSpace;
    [read] UInt32 CriticalOverlayThreshold;
    [read] UInt32 WarningOverlayThreshold;

    UInt32 GetOverlayFiles(
        [in] string Volume,
        [out, EmbeddedInstance("UWF_OverlayFile")] string OverlayFiles[]
    );
    UInt32 SetWarningThreshold(
        UInt32 size
    );
    UInt32 SetCriticalThreshold(
        UInt32 size
    );
};

成员Members

下表列出的任何方法和属于此类的属性。The following tables list any methods and properties that belong to this class.

方法Methods

方法Methods 描述Description

UWF_Overlay.GetOverlayFilesUWF_Overlay.GetOverlayFiles

UWF 覆盖中返回缓存卷的文件的列表。Returns a list of files of a volume that were cached in the UWF overlay.

UWF_Overlay.SetWarningThresholdUWF_Overlay.SetWarningThreshold

设置监视 UWF 覆盖层的大小的警告阈值。Sets the warning threshold for monitoring the size of the UWF overlay.

UWF_Overlay.SetCriticalThresholdUWF_Overlay.SetCriticalThreshold

设置监视 UWF 覆盖层的大小的关键警告阈值。Sets the critical warning threshold for monitoring the size of the UWF overlay.

属性Properties

属性Property 数据类型Data type 限定符Qualifiers 描述Description

IdId

字符串string

[key][key]

唯一的 id。A unique ID. 此值始终设置为UWF_OverlayThis is always set to UWF_Overlay.

OverlayConsumptionOverlayConsumption

UInt32UInt32

[read][read]

当前的大小,以兆字节为单位,UWF 覆盖。The current size, in megabytes, of the UWF overlay.

AvailableSpaceAvailableSpace

UInt32UInt32

[read][read]

以兆字节表示,可用于在 UWF 覆盖区上的可用空间量。The amount of free space, in megabytes, available to the UWF overlay.

CriticalOverlayThresholdCriticalOverlayThreshold

UInt32UInt32

[read][read]

严重阈值大小,以兆字节为单位。The critical threshold size, in megabytes. UWF 发送严重阈值通知事件 UWF 覆盖大小达到或超过此值时。UWF sends a critical threshold notification event when the UWF overlay size reaches or exceeds this value.

WarningOverlayThresholdWarningOverlayThreshold

UInt32UInt32

[read][read]

警告阈值大小,以兆字节为单位。The warning threshold size, in megabytes. UWF 发送警告阈值通知事件 UWF 覆盖大小达到或超过此值时。UWF sends a warning threshold notification event when the UWF overlay size reaches or exceeds this value.

示例Examples

下面的示例演示如何通过 PowerShell 脚本中使用的 WMI 提供程序使用 UWF 覆盖。The following example demonstrates how to use the UWF overlay by using the WMI provider in a PowerShell script.

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

# Function to set the Unified Write Filter overlay warning threshold

function Set-OverlayWarningThreshold($ThresholdSize) {

# Retrieve the overlay WMI object

    $OverlayInstance = Get-WMIObject -namespace $NAMESPACE -class UWF_Overlay;

    if(!$OverlayInstance) {
        "Unable to get handle to an instance of the UWF_Overlay class"
        return;
    }

# Call the instance method to set the warning threshold value

    $retval = $OverlayInstance.SetWarningThreshold($ThresholdSize);

# Check the return value to verify that setting the warning threshold is successful

    if ($retval.ReturnValue -eq 0) {
        "Overlay warning threshold has been set to " + $ThresholdSize + " MB"
    } else {
        "Unknown Error: " + "{0:x0}" -f $retval.ReturnValue
    }
}

# Function to set the Unified Write Filter overlay critical threshold

function Set-OverlayCriticalThreshold($ThresholdSize) {

# Retrieve the overlay WMI object

    $OverlayInstance = Get-WMIObject -namespace $NAMESPACE -class UWF_Overlay;

    if(!$OverlayInstance) {
        "Unable to get handle to an instance of the UWF_Overlay class"
        return;
    }

# Call the instance method to set the warning threshold value

    $retval = $OverlayInstance.SetCriticalThreshold($ThresholdSize);

# Check the return value to verify that setting the critical threshold is successful

    if ($retval.ReturnValue -eq 0) {
        "Overlay critical threshold has been set to " + $ThresholdSize + " MB"
    } else {
        "Unknown Error: " + "{0:x0}" -f $retval.ReturnValue
    }
}

# Function to print the current overlay information

function Get-OverlayInformation() {

# Retrieve the Overlay WMI object

    $OverlayInstance = Get-WMIObject -namespace $NAMESPACE -class UWF_Overlay;

    if(!$OverlayInstance) {
        "Unable to get handle to an instance of the UWF_Overlay class"
        return;
    }

# Display the current values of the overlay properties

    "`nOverlay Consumption: " + $OverlayInstance.OverlayConsumption
    "Available Space: " + $OverlayInstance.AvailableSpace
    "Critical Overlay Threshold: " + $OverlayInstance.CriticalOverlayThreshold
    "Warning Overlay Threshold: " + $OverlayInstance.WarningOverlayThreshold
}

# Examples of using these functions

"`nSetting the warning threshold to 768 MB."
Set-OverlayWarningThreshold( 768 )

"`nSetting the critical threshold to 896 MB."
Set-OverlayCriticalThreshold( 896 )

"`nDisplaying the current state of the overlay."
Get-OverlayInformation

备注Remarks

只有一个UFW_覆盖实例存在使用 UWF 保护系统。Only one UFW_Overlay instance exists for a system protected with UWF.

要求Requirements

Windows EditionWindows Edition 支持Supported
Windows 10 家庭版Windows 10 Home No
Windows 10 专业版Windows 10 Pro No
Windows 10 企业版Windows 10 Enterprise Yes
Windows 10 教育版Windows 10 Education Yes

统一的写入筛选器Unified Write Filter