在 Windows PowerShell 中使用 DISM
部署映像服务和管理 (DISM) cmdlet 可用于执行与 DISM.exe 命令行工具相同的功能。 在许多情况下,DISM cmdlet 名称与其对应的 Dism.exe 选项相似,并且可使用相同的参数。 有关 PowerShell cmdlet 的详细信息,请参阅 DISM PowerShell。
DISM 命令到 DISM cmdlet 映射表
DISM cmdlet 名称并不总是直接对应于 Dism.exe 选项。 下表将 DISM 命令映射到其相应的 PowerShell cmdlet。
Dism.exe 命令 | DISM cmdlet |
---|---|
Dism.exe /Add-Capability | Add-WindowsCapability |
Dism.exe /Append-Image | Add-WindowsImage |
Dism.exe /Apply-Image | Expand-WindowsImage |
Dism.exe /Capture-Image | New-WindowsImage |
Dism.exe /Cleanup-MountPoints | Clear-WindowsCorruptMountPoint |
Dism.exe /Commit-Image | Save-WindowsImage |
Dism.exe /Export-Image | Export-WindowsImage |
Dism.exe /Get-Capabilities | Get-WindowsCapability |
Dism.exe /Get-ImageInfo | Get-WindowsImage |
Dism.exe /Get-MountedImageInfo | Get-WindowsImage -Mounted |
Dism.exe /Get-WimBootEntry | Get-WIMBootEntry |
Dism.exe /List-Image | Get-WindowsImageContent |
Dism.exe /Mount-Image | Mount-WindowsImage |
Dism.exe /Split-Image | Split-WindowsImage |
Dism.exe /Remove-Capability | Remove-WindowsCapability |
Dism.exe /Remove-Image | Remove-WindowsImage |
Dism.exe /Remount-Image | Mount-WindowsImage -Remount |
Dism.exe /Unmount-Image | Dismount-WindowsImage |
Dism.exe /Update-WimBootEntry | Update-WIMBootEntry |
Dism.exe /Image:<...> /Add-Driver | Add-WindowsDriver |
Dism.exe /Image:<...> /Add-Package | Add-WindowsPackage |
Dism.exe /Image:<...> /Add-ProvisionedAppxPackage | Add-AppxProvisionedPackage |
Dism.exe /Image:<...> /Cleanup-Image /CheckHealth | Repair-WindowsImage -CheckHealth |
Dism.exe /Image:<...> /Cleanup-Image /ScanHealth | Repair-WindowsImage -ScanHealth |
Dism.exe /Image:<...> /Cleanup-Image /RestoreHealth | Repair-WindowsImage -RestoreHealth |
Dism.exe /Image:<...> /Disable-Feature | Disable-WindowsOptionalFeature |
Dism.exe /Image:<...> /Enable-Feature | Enable-WindowsOptionalFeature |
Dism.exe /Image:<...> /Export-Driver | Export-WindowsDriver |
Dism.exe /Image:<...> /Get-CurrentEdition | Get-WindowsEdition -Current |
Dism.exe /Image:<...> /Get-Driverinfo | Get-WindowsDriver -Driver |
Dism.exe /Image:<...> /Get-Drivers | Get-WindowsDriver |
Dism.exe /Image:<...> /Get-Featureinfo | Get-WindowsOptionalFeature -FeatureName |
Dism.exe /Image:<...> /Get-Features | Get-WindowsOptionalFeature |
Dism.exe /Image:<...> /Get-Packageinfo | Get-WindowsPackage -PackagePath |
Dism.exe /Image:<...> /Get-Packages | Get-WindowsPackage |
Dism.exe /Image:<...> /Get-ProvisionedAppxPackages | Get-AppxProvisionedPackage |
Dism.exe /Image:<...> /Get-ReservedStorageState | Get-WindowsReservedStorageState |
Dism.exe /Image:<...> /Get-TargetEditions | Get-WindowsEdition -Target |
Dism.exe /Image:<...> /Optimize-Image | Optimize-WindowsImage |
Dism.exe /Image:<...> /Remove-Driver | Remove-WindowsDriver |
Dism.exe /Image:<...> /Remove-Package | Remove-WindowsPackage |
Dism.exe /Image:<...> /Remove-ProvisionedAppxPackage | Remove-AppxProvisionedPackage |
Dism.exe /Image:<...> /Set-Edition | Set-WindowsEdition |
Dism.exe /Image:<...> /Set-ProductKey | Set-WindowsProductKey |
Dism.exe /Image:<...> /Set-ProvisionedAppxDataFile | Set-AppXProvisionedDataFile |
Dism.exe /Image:<...> /Set-ReservedStorageState | Set-WindowsReservedStorageState |
在 WinPE 中使用 DISM Powershell 模块
可以为WinPE 添加 PowerShell 支持。 要了解详细信息,请访问为 Windows PE 添加 PowerShell 支持。
在以前版本的 Windows 中使用 DISM PowerShell 模块
DISM PowerShell 模块包含在 Windows 10 和 Windows Server 2016 中。 在其他受支持的操作系统中,可安装包含 DISM PowerShell 模块的 Windows 评估和部署工具包 (ADK)。 有关详细信息,请参阅本主题的上一版本。