Remove-WindowsImage
Deletes the specified volume image from a WIM file that has multiple volume images.
構文
Parameter Set: InputByFilePathAndIndex
Remove-WindowsImage -ImagePath <String> -Index <UInt32> [-CheckIntegrity] [-LogLevel <LogLevel> {Errors | Warnings | WarningsInfo} ] [-LogPath <String> ] [-ScratchDirectory <String> ] [ <CommonParameters>]
Parameter Set: InputByFilePathAndName
Remove-WindowsImage -ImagePath <String> -Name <String> [-CheckIntegrity] [-LogLevel <LogLevel> {Errors | Warnings | WarningsInfo} ] [-LogPath <String> ] [-ScratchDirectory <String> ] [ <CommonParameters>]
詳細説明
The Remove-WindowsImage cmdlet deletes the specified volume image from a WIM file that has multiple volume images. This cmdlet deletes only the metadata entries and XML entries. It does not delete the stream data and does not optimize the WIM file.
This command-line option does not apply to virtual hard disk (VHD) files.
パラメーター
-CheckIntegrity
Add—WindowsImage、Dismount-WindowsImage、Save-WindowsImage のいずれかのコマンドレットと共に使用し、.wim ファイルの破損を検出および追跡します。Expand-WindowsImage コマンドレットまたは Mount-WindowsImage コマンドレットと共に使用したとき、DISM が .wim ファイルの破損を検出した場合、CheckIntegrity の動作が停止します。
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-ImagePath<String>
Specifies the location of a WIM file.
Aliases |
none |
必須/オプション |
true |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-Index<UInt32>
WIM ファイルまたは VHD ファイル内の Windows イメージのインデックス番号を指定します。VHD ファイルの場合、インデックスを 1 にする必要があります。
Aliases |
none |
必須/オプション |
true |
位置 |
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 |
-Name<String>
Specifies the name of an image in a WIM file.
Aliases |
none |
必須/オプション |
true |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-ScratchDirectory<String>
サービスの実行中、ファイルを展開するときに使用する一時ディレクトリを指定します。このディレクトリは、ローカルに存在する必要があります。指定しなかった場合、\Windows\%Temp%
ディレクトリが使用され、DISM を実行するたびに、16 進値のサブディレクトリ名がランダムに生成されます。スクラッチ ディレクトリ内の項目は、各操作後に削除されます。インストール用のパッケージ (.cab または .msu ファイル) を展開するためのスクラッチ ディレクトリとしてネットワーク共有場所を使用することは避けてください。サービス中に一時的に使用するファイルの展開先として使用するディレクトリは、ローカル ディレクトリにする必要があります。
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.ImageObjectWithState
出力
出力型は、コマンドレットが出力するオブジェクトの型です。
- Microsoft.Dism.Commands.ImageObject
使用例
Example 1: Remove the first image from a WIM file
This command removes the first image in c:\imagestore\custom.wim.
PS C:\> Remove-WindowsImage -ImagePath "c:\imagestore\custom.wim" -Index 1 -CheckIntegrity
Example 2: Remove an image from a WIM file by name
This command removes the image named Starter that is located in c:\imagestore\custom.wim.
PS C:\> Remove-WindowsImage -ImagePath "c:\imagestore\custom.wim" -Name "Starter" -CheckIntegrity