UWF_OverlayConfig
Muestra y configura los valores globales para la superposición de filtro de escritura unificado (UWF). Puede modificar el tamaño máximo y el tipo de superposición de UWF.
Sintaxis
class UWF_OverlayConfig{
[key, Read] boolean CurrentSession;
[read] UInt32 Type;
[read] SInt32 MaximumSize;
UInt32 SetType(
UInt32 type
);
UInt32 SetMaximumSize(
UInt32 size
);
};
Miembros
En las tablas siguientes se enumeran los métodos y propiedades que pertenecen a esta clase.
Métodos
Método | Descripción |
---|---|
UWF_OverlayConfig.SetMaximumSize | Establece el tamaño máximo de caché, en megabytes, de la superposición. |
UWF_OverlayConfig.SetType | Establece el tipo de superposición de UWF en basado en RAM o en disco. |
Propiedades
Propiedad | Tipo de datos | Calificadores | Descripción |
---|---|---|---|
CurrentSession | Booleano | [clave, lectura] | Indica para qué sesión contiene la configuración el objeto.
- True para la sesión - actual False para la siguiente sesión que comienza después de un reinicio. |
Tipo | UInt32 | [leer] | Indica el tipo de superposición.
- 0 para una superposición - basada en RAM1 para una superposición basada en disco. |
MaximumSize | SInt32 | [leer] | Indica el tamaño máximo de caché, en megabytes, de la superposición. |
Observaciones
Los cambios en la configuración de superposición surten efecto en el siguiente reinicio en el que UWF está habilitado.
Para poder cambiar las propiedades Type o MaximumSize , UWF debe deshabilitarse en la sesión actual.
Por ejemplo:
En el ejemplo siguiente se muestra cómo cambiar el tamaño máximo o el tipo de almacenamiento de la superposición en UWF mediante el proveedor instrumental de administración de Windows (WMI) en un script de PowerShell.
El script de PowerShell crea dos funciones para modificar la configuración de superposición. A continuación, se muestra cómo usar las funciones. La primera función, Set-OverlaySize, establece el tamaño máximo de la superposición. La segunda función, Set-OverlayType, establece el tipo de la superposición en basado en RAM o en disco.
$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
Requisitos
Edición de Windows | Se admite |
---|---|
Windows Home | No |
Windows Pro | No |
Windows Enterprise | Sí |
Windows Education | Sí |
Windows IoT Enterprise | Sí |
Artículos relacionados
Referencia del proveedor WMI de filtro de escritura unificado