UWF_Overlay

包含統一寫入篩選器 (UWF) 重迭的目前大小,並管理重迭大小的嚴重和警告臨界值。

語法

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
    );
};

成員

下表列出屬於這個類別的任何方法和屬性。

方法 描述
UWF_Overlay.GetOverlayFiles 傳回 UWF 重迭中快取之磁片區的檔案清單。
UWF_Overlay.SetWarningThreshold 設定監視 UWF 重迭大小的警告臨界值。
UWF_Overlay.SetCriticalThreshold 設定監視 UWF 重迭大小的重要警告臨界值。

屬性

屬性 資料類型 限定詞 描述
識別碼 字串 [key] 唯一 ID。 這一律設定為 UWF_Overlay
OverlayConsumption UInt32 [read] UWF 重迭的目前大小,以 MB 為單位。
AvailableSpace UInt32 [read] UWF 重迭可用的可用空間量,以 MB 為單位。
CriticalOverlayThreshold UInt32 [read] 重大閾值大小,以 MB 為單位。 當 UWF 重迭大小達到或超過此值時,UWF 會傳送重大閾值通知事件。
WarningOverlayThreshold UInt32 [read] 警告臨界值大小,以 MB 為單位。 當 UWF 重迭大小達到或超過此值時,UWF 會傳送警告閾值通知事件。

範例

下列範例示範如何在 PowerShell 腳本中使用 WMI 提供者來使用 UWF 重迭。

$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

備註

使用 UWF 保護的系統只有一個 UFW_Overlay 實例存在。

規格需求

Windows 版本 支援
Windows 首頁 No
Windows 專業版
Windows 企業版
Windows 教育版
Windows IoT 企業版 是的