UWF_Overlay
Berisi ukuran overlay Unified Write Filter (UWF) saat ini dan mengelola ambang batas kritis dan peringatan untuk ukuran overlay.
Sintaks
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
);
};
Anggota
Tabel berikut mencantumkan metode dan properti apa pun yang termasuk dalam kelas ini.
Metode | Deskripsi |
---|---|
UWF_Overlay.GetOverlayFiles | Mengembalikan daftar file volume yang di-cache dalam overlay UWF. |
UWF_Overlay.SetWarningThreshold | Mengatur ambang peringatan untuk memantau ukuran overlay UWF. |
UWF_Overlay.SetCriticalThreshold | Mengatur ambang batas peringatan kritis untuk memantau ukuran overlay UWF. |
Properti
Properti | Jenis Data | Kualifikasi | Deskripsi |
---|---|---|---|
Id | string | [kunci] | ID unik. Ini selalu diatur ke UWF_Overlay. |
OverlayConsumption | UInt32 | [baca] | Ukuran saat ini, dalam megabyte, dari overlay UWF. |
AvailableSpace | UInt32 | [baca] | Jumlah ruang kosong, dalam megabyte, tersedia untuk overlay UWF. |
CriticalOverlayThreshold | UInt32 | [baca] | Ukuran ambang kritis, dalam megabyte. UWF mengirimkan peristiwa pemberitahuan ambang kritis ketika ukuran overlay UWF mencapai atau melebihi nilai ini. |
WarningOverlayThreshold | UInt32 | [baca] | Ukuran ambang peringatan, dalam megabyte. UWF mengirimkan peristiwa pemberitahuan ambang peringatan ketika ukuran overlay UWF mencapai atau melebihi nilai ini. |
Contoh
Contoh berikut menunjukkan cara menggunakan overlay UWF dengan menggunakan penyedia WMI dalam skrip 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
Keterangan
Hanya ada satu instans UFW_Overlay untuk sistem yang dilindungi dengan UWF.
Persyaratan
Edisi Windows | Didukung |
---|---|
Windows Home | Tidak |
Windows Pro | Tidak |
Windows Enterprise | Ya |
Windows Education | Ya |
Windows IoT Enterprise | Ya |