Add-WindowsPackage
Add-WindowsPackage
Adds a single .cab or .msu file to a Windows image.
構文
Parameter Set: Offline
Add-WindowsPackage -PackagePath <String> -Path <String> [-IgnoreCheck] [-LogLevel <LogLevel> {Errors | Warnings | WarningsInfo} ] [-LogPath <String> ] [-NoRestart] [-PreventPending] [-ScratchDirectory <String> ] [-SystemDrive <String> ] [-WindowsDirectory <String> ] [ <CommonParameters>]
Parameter Set: Online
Add-WindowsPackage -Online -PackagePath <String> [-IgnoreCheck] [-LogLevel <LogLevel> {Errors | Warnings | WarningsInfo} ] [-LogPath <String> ] [-NoRestart] [-PreventPending] [-ScratchDirectory <String> ] [-SystemDrive <String> ] [-WindowsDirectory <String> ] [ <CommonParameters>]
詳細説明
The Add-WindowsPackage cmdlet installs a specified .cab or .msu package in the image.
パラメーター
-IgnoreCheck
Skips the applicability check for each package.
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-LogLevel<LogLevel>
ログに表示される最大出力レベルを指定します。既定のログ レベルは 3 です。指定できる値は次のとおりです。1 = エラーのみ2 = エラーと警告3 = エラー、警告、情報4 = これらすべての情報に加え、デバッグ出力
Aliases |
LL |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-LogPath<String>
ログ出力先の完全パスとファイル名を指定します。設定しなかった場合、既定値の %WINDIR%\Logs\Dism\dism.log
が使用されます。Windows PE の既定のディレクトリは RAMDISK スクラッチ領域 (32 MB) です。ログ ファイルは自動的にアーカイブされます。アーカイブされたログ ファイルはファイル名に .bak が追加されて保存され、新たなログ ファイルが生成されます。ログ ファイルがアーカイブされるたびに、.bak ファイルが上書きされます。ドメインに参加していないネットワーク共有を使う場合、DISM ログのパスを設定する前に、ドメイン資格情報を指定して net use コマンドを使ってアクセス許可を設定します。
Aliases |
LP |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-NoRestart
再起動を抑制します。再起動が不要である場合、このコマンドは何も行いません。これは、アプリケーションで再起動を要求するプロンプトが表示されたり、自動で再起動されたりしないようにするためのオプションです。
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-Online
現在ローカル コンピューターで実行中のオペレーティング システムを操作の対象に指定します。
Aliases |
none |
必須/オプション |
true |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-PackagePath<String>
Specifies the location of the package to add to the image.
Valid values are:
--A single .cab or .msu file.
--A folder that contains a single expanded .cab file.
--A folder that contains a single .msu file.
--A folder that contains multiple .cab or .msu files.
If PackagePath is a folder that contains a .cab or .msu files at its root, any subfolders will also be recursively checked for .cab and .msu files.
Aliases |
none |
必須/オプション |
true |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-Path<String>
操作するオフライン Windows イメージのルート ディレクトリの完全パスを指定します。Windows という名前のディレクトリがルート ディレクトリのサブディレクトリではない場合、-WindowsDirectory を指定する必要があります。
Aliases |
none |
必須/オプション |
true |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-PreventPending
Skips the installation of the package if the package or Windows image has pending online actions.
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-ScratchDirectory<String>
サービスの実行中、ファイルを展開するときに使用する一時ディレクトリを指定します。このディレクトリは、ローカルに存在する必要があります。指定しなかった場合、\Windows\%Temp%
ディレクトリが使用され、DISM を実行するたびに、16 進値のサブディレクトリ名がランダムに生成されます。スクラッチ ディレクトリ内の項目は、各操作後に削除されます。インストール用のパッケージ (.cab または .msu ファイル) を展開するためのスクラッチ ディレクトリとしてネットワーク共有場所を使用することは避けてください。サービス中に一時的に使用するファイルの展開先として使用するディレクトリは、ローカル ディレクトリにする必要があります。
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-SystemDrive<String>
BootMgr ファイルの場所へのパスを指定します。これは、BootMgr ファイルの置かれているパーティションが、コマンドの実行されているパーティションと異なる場合にのみ必要となります。インストールされている Windows イメージを Windows PE 環境から操作するには、-SystemDrive を使用します。
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-WindowsDirectory<String>
イメージのパスを基準にして、Windows ディレクトリへのパスを指定します。Windows ディレクトリへの完全パスは使用できません。相対パスで指定する必要があります。指定しない場合、オフライン イメージ ディレクトリのルートにある Windows ディレクトリが既定で使用されます。
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
<CommonParameters>
このコマンドレットは共通のパラメーターをサポートしています(-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、および -OutVariable)。詳細については、TechNet の「 「about_CommonParameters」 (https://go.microsoft.com/fwlink/p/?LinkID=113216) を参照してください。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
- System.String[]
- Microsoft.Dism.Commands.ImageObject
- Microsoft.Dism.Commands.BasicPackageObject
- Microsoft.Dism.Commands.AdvancedPackageObject
出力
出力型は、コマンドレットが出力するオブジェクトの型です。
- Microsoft.Dism.Commands.ImageObject
使用例
Example 1: Add a package to an online image
This command adds a .cab package to an online image.
PS C:\> Add-WindowsPackage –Online –PackagePath "c:\packages\package.cab"
Example 2: Add a file to a mounted image
This command adds an .msu file to a mounted Windows image unless there are pending actions on the package or the image.
PS C:\> Add-WindowsPackage –Path "c:\offline" –PackagePath "c:\packages\demo_package.msu" -PreventPending
Example 3: Add several packages to a mounted image
This command adds all of the packages in a folder to a mounted Windows image without checking if they are applicable to the image.
PS C:\> Add-WindowsPackage –Path "c:\offline" –PackagePath "c:\packages" -IgnoreCheck