UWF_Overlay

Contiene le dimensioni correnti della sovrimpressione UWF (Unified Write Filter) e gestisce le soglie critiche e di avviso per le dimensioni della sovrimpressione.

Sintassi

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

Nelle tabelle seguenti sono elencati i metodi e le proprietà appartenenti a questa classe.

Metodi Descrizione
UWF_Overlay.GetOverlayFiles Restituisce un elenco di file di un volume memorizzati nella cache nella sovrimpressione UWF.
UWF_Overlay.SetWarningThreshold Imposta la soglia di avviso per il monitoraggio delle dimensioni della sovrimpressione UWF.
UWF_Overlay.SetCriticalThreshold Imposta la soglia di avviso critica per il monitoraggio delle dimensioni della sovrimpressione UWF.

Proprietà

Proprietà Tipo di dati Qualificatori Descrizione
ID string [key] ID univoco. Questa opzione è sempre impostata su UWF_Overlay.
OverlayConsumption UInt32 [lettura] Dimensione corrente, in megabyte, della sovrimpressione UWF.
AvailableSpace UInt32 [lettura] Quantità di spazio libero, in megabyte, disponibile per la sovrimpressione UWF.
CriticalOverlayThreshold UInt32 [lettura] Dimensione della soglia critica, in megabyte. UWF invia un evento di notifica soglia critico quando la dimensione della sovrimpressione UWF raggiunge o supera questo valore.
WarningOverlayThreshold UInt32 [lettura] Dimensioni della soglia di avviso, in megabyte. UWF invia un evento di notifica di soglia di avviso quando la dimensione della sovrimpressione UWF raggiunge o supera questo valore.

Esempio

Nell'esempio seguente viene illustrato come usare la sovrimpressione UWF usando il provider WMI in uno script di PowerShell.

$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

Commenti

Esiste una sola istanza di UFW_Overlay per un sistema protetto con UWF.

Requisiti

Edizione per Windows Supportato
Windows Home No
Windows Pro No
Windows Enterprise
Windows Education
Windows IoT Enterprise