Remove-WindowsImage
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> ] [-LogPath <String> ] [-ScratchDirectory <String> ] [ <CommonParameters>]
Parameter Set: InputByFilePathAndName
Remove-WindowsImage -ImagePath <String> -Name <String> [-CheckIntegrity] [-LogLevel <LogLevel> ] [-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 ファイルの破損を検出して追跡します。CheckIntegrity は、Expand-WindowsImage コマンドレットまたは Mount-WindowsImage コマンドレットと共に使用したときに、.wim ファイルが破損していることを DISM で検出した場合、操作を停止します。
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-ImagePath<String>
Specifies the location of a WIM file.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-Index<UInt32>
WIM ファイルまたは VHD ファイル内の Windows イメージのインデックス番号を指定します。VHD ファイルの場合、このインデックスは 1 にする必要があります。
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-LogLevel<LogLevel>
ログに表示する最大の出力レベルを指定します。既定のログ レベルは 3 です。指定できる値は次のとおりです。1 = エラーのみ2 = エラーと警告3 = エラー、警告、および情報4 = 以上のすべての情報とデバッグ出力
エイリアス |
LL |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-LogPath<String>
ログの記録先の完全なパスとファイル名を指定します。設定しない場合、既定値は %WINDIR%\Logs\Dism\dism.log
です。Windows PE では、既定のディレクトリは RAMDISK スクラッチ領域 (最低 32 MB) です。ログ ファイルは自動的にアーカイブされます。アーカイブされたログ ファイルは、ファイル名に .bak が追加されて保存され、新しいログ ファイルが生成されます。ログ ファイルがアーカイブされるたびに、.bak ファイルが上書きされます。ドメインに参加していないネットワーク共有を使用する場合は、DISM ログのパスを設定する前に、ドメイン資格情報を指定して net use コマンドを使用し、アクセス許可を設定します。
エイリアス |
LP |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-Name<String>
Specifies the name of an image in a WIM file.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-ScratchDirectory<String>
操作の実行中に使用するファイルの展開時に使用される一時ディレクトリを指定します。このディレクトリはローカルに存在する必要があります。指定しない場合は \Windows\%Temp%
ディレクトリが使用され、サブディレクトリ名には DISM の実行ごとにランダムに生成される 16 進数値が使用されます。各操作の終了後、このスクラッチ ディレクトリ内の項目は削除されます。インストール用のパッケージ (.cab または .msu ファイル) を展開する際に、ネットワーク共有の場所をスクラッチ ディレクトリとして使用しないでください。操作の実行中にファイルを展開するために一時的に使用されるディレクトリは、ローカル ディレクトリである必要があります。
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 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
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
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