共用方式為


WindowsPackageCab

概要

從 Windows 封包 () .cab 檔案安裝或卸載套件。

語法

WindowsPackageCab [String] #ResourceName
{
    Ensure = [string]{ Absent | Present }
    Name = [string]
    SourcePath = [string]
    [DependsOn = [string[]]]
    [LogPath = [string]]
    [PsDscRunAsCredential = [PSCredential]]
}

描述

資源 WindowsPackageCab 可讓您確保是否已安裝 Windows 封包 () .cab 檔案中的套件。

規格需求

  • 目的電腦必須能夠存取 DISM PowerShell 模組

金鑰屬性

名稱

將封裝的名稱指定為字串。

Type: System.String

必要屬性

Ensure

指定是否應該安裝套件。 將此屬性設定為 Present 以安裝套件。 將此屬性設定為 Absent 以卸載套件。

Type: System.String
Accepted Values:
  - Absent
  - Present

SourcePath

將封裝檔案 .cab 的路徑指定為字串。 如果檔案不存在,資源會在嘗試安裝或卸載套件時擲回不正確引數例外狀況。

Type: System.String

選擇性屬性

LogPath

指定要記錄安裝或卸載套件之檔案的路徑。

如果未設定,資源會將記錄寫入至 %WINDIR%\Logs\Dism\dism.log

Type: System.String
Behavior: Write
Default Value: No

範例