UWF_服務UWF_Servicing

這個類別包含屬性和方法可讓您查詢和控制整合寫入篩選器 (UWF) 服務模式。This class contains properties and methods that enable you to query and control Unified Write Filter (UWF) servicing mode.

語法Syntax

class UWF_Servicing {
    [key, read] boolean CurrentSession;
    [read] boolean ServicingEnabled;

    UInt32 Enable();
    UInt32 Disable();
    UInt32 UpdateWindows(
        [out] UInt32 UpdateStatus
    );
};

成員Members

下表列出屬於這個類別的屬性與方法。The following tables list the methods and properties that belong to this class.

方法Methods

方法Method 描述Description

UWF_Servicing.DisableUWF_Servicing.Disable

停用整合寫入篩選器 (UWF) 服務模式。Disables Unified Write Filter (UWF) servicing mode.

系統會保留服務模式下一步 之後重新啟動的工作階段中。The system leaves servicing mode in the next session that follows a restart.

UWF_Servicing.EnableUWF_Servicing.Enable

可讓整合寫入篩選器 (UWF) 服務模式。Enables Unified Write Filter (UWF) servicing mode.

系統會進入維護模式下一步 之後重新啟動的工作階段中。The system enters servicing mode in the next session that follows a restart.

UWF_Servicing.UpdateWindowsUWF_Servicing.UpdateWindows

呼叫您的裝置執行 Windows 10 企業版的 Windows Update 下載及安裝重大和安全性更新。Calls Windows Update to download and install critical and security updates for your device running Windows 10 Enterprise.

屬性Properties

屬性Property 資料類型Data type 限定詞Qualifiers 描述Description

CurrentSessionCurrentSession

布林值Boolean

[索引鍵,讀取][key, read]

表示啟用服務的時機。Indicates when to enable servicing.

True如果服務已啟用在目前工作階段中。False如果都將遵循重新啟動的工作階段中啟用服務。True if servicing is enabled in the current session; False if servicing will be enabled in the session that follows a restart.

ServiceEnabledServiceEnabled

布林值Boolean

[讀取][read]

表示系統是處於服務模式中目前的工作階段,或將處於服務模式下一步 之後重新啟動的工作階段中。Indicates if the system is in servicing mode in the current session, or will be in servicing mode in the next session that follows a restart.

如果服務已啟用,否則FalseTrue if servicing is enabled; otherwise, False.

備註Remarks

這個類別只會有兩個執行個體,其中目前的工作階段,而另一個用於之後重新啟動下一個工作階段。This class only has two instances, one for the current session, and another for the next session that follows a restart.

範例Example

下列範例示範如何啟用和停用 UWF 的裝置上的服務模式的 PowerShell 指令碼中使用 Windows Management Instrumentation (WMI) 提供者。The following example shows how to enable and disable UWF servicing mode on a device by using the Windows Management Instrumentation (WMI) provider in a PowerShell script.

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

# Define common parameters

$CommonParams = @{"namespace"=$NAMESPACE; "computer"=$COMPUTER}

# Enable UWF servicing

$nextSession = Get-WmiObject -class UWF_Servicing @CommonParams | where {
    $_.CurrentSession -eq $false
}

if ($nextSession) {

    $nextSession.Enable() | Out-Null;
    Write-Host "This device is enabled for servicing mode after the next restart."
}

# Disable UWF servicing

$nextSession = Get-WmiObject -class UWF_Servicing @CommonParams | where {
    $_.CurrentSession -eq $false
}

if ($nextSession) {

    $nextSession.Disable() | Out-Null;
    Write-Host "Servicing mode is now disabled for this device."
}

需求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