ProcessSet
概要
使用一般設定管理多個 Windows 進程。
語法
ProcessSet [String] #ResourceName
{
[DependsOn = [String[]]]
[PsDscRunAsCredential = [PSCredential]]
Path = [String[]]
[Ensure = [String]]
[Credential = [PSCredential]]
[StandardOutputPath = [String]]
[StandardErrorPath = [String]]
[StandardInputPath = [String]]
[WorkingDirectory = [String]]
}
描述
ProcessSet
複合資源可讓您使用一組有限的常見選項來設定多個 Windows 進程。 若要管理具有更多控制權的進程,包括將引數傳遞至進程的能力,請使用 WindowsProcess 資源。
規格需求
無。
金鑰屬性
路徑
指定進程可執行檔的路徑。 如果檔案可透過 PATH
環境變數存取,您可以指定檔案的名稱。 否則,請指定檔案的完整路徑。
不支援相對路徑。
Type: System.String[]
Behavior: Key
選擇性屬性
認證
指定要執行進程之帳戶的認證。
如果此屬性設定為本機系統帳戶,則無法設定 StandardOutputPath、 StandardInputPath或 WorkingDirectory 屬性。 如果您這麼做,資源會擲回不正確引數例外狀況。
Type: System.Management.Automation.PSCredential
Default Value: None
Ensure
指定進程是否應該執行。 將此屬性設定為 , Present
以便在進程未執行時啟動進程。 將此屬性設定為 , Absent
以便在進程正在執行時停止進程。
預設值是 Present
。
Type: System.String
Accepted Values:
- Absent
- Present
Default Value: Present
StandardErrorPath
指定檔案的完整路徑,讓進程寫入其標準錯誤資料流程。 不支援相對路徑。 如果檔案存在,則會遭到覆寫。
將 Ensure 屬性設定為 Absent
時,請勿設定此屬性。 如果您這麼做,資源會擲回不正確引數例外狀況。
Type: System.String
Default Value: None
StandardInputPath
指定檔案的完整路徑,讓進程讀取為其標準輸入資料流程。 不支援相對路徑。
將 Ensure 屬性設定為 Absent
或 將 Credential 屬性設定為本機系統帳戶時,請勿設定此屬性。 如果您這麼做,資源會擲回不正確引數例外狀況。
Type: System.String
Default Value: None
StandardOutputPath
指定檔案的完整路徑,讓進程寫入其標準輸出資料流程。 不支援相對路徑。 如果檔案存在,則會遭到覆寫。
將 Ensure 屬性設定為 Absent
或 將 Credential 屬性設定為本機系統帳戶時,請勿設定此屬性。 如果您這麼做,資源會擲回不正確引數例外狀況。
Type: System.String
Default Value: None
WorkingDirectory
為進程的工作目錄指定資料夾的完整路徑。 不支援相對路徑。
將 Ensure 屬性設定為 Absent
或 將 Credential 屬性設定為本機系統帳戶時,請勿設定此屬性。 如果您這麼做,資源會擲回不正確引數例外狀況。
Type: System.String
Default Value: None
唯讀屬性
HandleCount
進程開啟的控制碼數目。
Type: System.SInt32
Behavior: Read
NonPagedMemorySize
為進程配置的非分頁式記憶體數量,以位元組為單位。
Type: System.UInt64
Behavior: Read
PagedMemorySize
為進程配置的分頁記憶體數量,以位元組為單位。
Type: System.UInt64
Behavior: Read
ProcessCount
目前執行之指定進程的實例數目。
Type: System.SInt32
Behavior: Read
ProcessId
進程的唯一識別碼。
Type: System.SInt32
Behavior: Read
VirtualMemorySize
為進程配置的虛擬記憶體數量,以位元組為單位。
Type: System.UInt64
Behavior: Read
範例
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應