Install features/packages for Windows using DISM, which is useful for minions not running server versions of Windows. Some functions are only available on Windows 10.
Install a capability
capability (str) -- The capability to install
source (Optional[str]) -- The optional source of the capability. Default is set by group policy and can be Windows Update.
limit_access (Optional[bool]) -- Prevent DISM from contacting Windows Update for the source package
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
restart (Optional[bool]) -- Reboot the machine if required by the install
NotImplementedError -- For all versions of Windows that are not Windows 10
and later. Server editions of Windows use ServerManager instead. --
A dictionary containing the results of the command
CLI Example:
salt '*' dism.add_capability Tools.Graphics.DirectX~~~~0.0.1.0
Install a feature using DISM
feature (str) -- The feature to install
package (Optional[str]) -- The parent package for the feature. You do not have to specify the package if it is the Windows Foundation Package. Otherwise, use package to specify the parent package of the feature
source (Optional[str]) -- The optional source of the capability. Default is set by group policy and can be Windows Update
limit_access (Optional[bool]) -- Prevent DISM from contacting Windows Update for the source package
enable_parent (Optional[bool]) -- True will enable all parent features of the specified feature
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
restart (Optional[bool]) -- Reboot the machine if required by the install
A dictionary containing the results of the command
CLI Example:
salt '*' dism.add_feature NetFx3
Install a package using DISM
package (str) --
The package to install. Can be a .cab file, a .msu file, or a folder
Note
An .msu package is supported only when the target image is offline, either mounted or applied.
ignore_check (Optional[bool]) -- Skip installation of the package if the applicability checks fail
prevent_pending (Optional[bool]) -- Skip the installation of the package if there are pending online actions
image (Optional[str]) -- The path to the root directory of an offline Windows image. If
None
is passed, the running operating system is targeted.
Default is None.
restart (Optional[bool]) -- Reboot the machine if required by the install
A dictionary containing the results of the command
CLI Example:
salt '*' dism.add_package C:\Packages\package.cab
Provision a package using DISM. A provisioned package will install for new users on the system. It will also be reinstalled on each user if the system is updated.
New in version 3007.0.
package (str) --
The package to install. Can be one of the following:
.appx
or .appxbundle
.msix
or .msixbundle
.ppkg
image (Optional[str]) -- The path to the root directory of an offline Windows image. If
None
is passed, the running operating system is targeted.
Default is None
.
restart (Optional[bool]) -- Reboot the machine if required by the installation. Default is
False
A dictionary containing the results of the command
CLI Example:
salt '*' dism.add_provisioned_package C:\Packages\package.appx
salt '*' dism.add_provisioned_package C:\Packages\package.appxbundle
salt '*' dism.add_provisioned_package C:\Packages\package.msix
salt '*' dism.add_provisioned_package C:\Packages\package.msixbundle
salt '*' dism.add_provisioned_package C:\Packages\package.ppkg
List the capabilities available on the system
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
NotImplementedError -- For all versions of Windows that are not Windows 10
and later. Server editions of Windows use ServerManager instead. --
A list of available capabilities
CLI Example:
salt '*' dism.installed_capabilities
List the features available on the system
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
A list of available features
CLI Example:
salt '*' dism.available_features
List all capabilities on the system
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
NotImplementedError -- For all versions of Windows that are not Windows 10
and later. Server editions of Windows use ServerManager instead. --
A list of capabilities
CLI Example:
salt '*' dism.get_capabilities
List features on the system or in a package
package (Optional[str]) --
The full path to the package. Can be either a .cab file or a folder. Should point to the original source of the package, not to where the file is installed. You cannot use this command to get package information for .msu files
This can also be the name of a package as listed in
dism.installed_packages
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
A list of features
CLI Example:
# Return all features on the system salt '*' dism.get_features # Return all features in package.cab salt '*' dism.get_features C:\packages\package.cab # Return all features in the calc package salt '*' dism.get_features Microsoft.Windows.Calc.Demo~6595b6144ccf1df~x86~en~1.0.0.0
Get the actual package name on the system based on the KB name
New in version 3006.0.
The name of the package found on the system None: If the package is not installed on the system
CLI Example:
# Get the package name for KB1231231
salt '*' dism.get_kb_package_name KB1231231
# Get the package name for KB1231231 using just the number
salt '*' dism.get_kb_package_name 1231231
List the capabilities installed on the system
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
NotImplementedError -- For all versions of Windows that are not Windows 10
and later. Server editions of Windows use ServerManager instead. --
A list of installed capabilities
CLI Example:
salt '*' dism.installed_capabilities
List the features installed on the system
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
A list of installed features
CLI Example:
salt '*' dism.installed_features
List the packages installed on the system
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
A list of installed packages
CLI Example:
salt '*' dism.installed_packages
Display information about a package
package (str) -- The full path to the package. Can be either a .cab file or a folder. Should point to the original source of the package, not to where the file is installed. You cannot use this command to get package information for .msu files
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
A dictionary containing the results of the command
CLI Example:
salt '*' dism.package_info C:\packages\package.cab
List the packages installed on the system
New in version 3007.0.
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
A list of installed packages
CLI Example:
salt '*' dism.installed_packages
Uninstall a capability
NotImplementedError -- For all versions of Windows that are not Windows 10
and later. Server editions of Windows use ServerManager instead. --
A dictionary containing the results of the command
CLI Example:
salt '*' dism.remove_capability Tools.Graphics.DirectX~~~~0.0.1.0
Disables the feature.
feature (str) -- The feature to uninstall
remove_payload (Optional[bool]) -- Remove the feature's payload. Must supply source when enabling in the future.
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
restart (Optional[bool]) -- Reboot the machine if required by the install
A dictionary containing the results of the command
CLI Example:
salt '*' dism.remove_feature NetFx3
Remove a package by passing a KB number. This searches the installed
packages to get the full package name of the KB. It then calls the
dism.remove_package
function to remove the package.
New in version 3006.0.
kb (str) -- The name of the KB to remove. Can also be just the KB number
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
restart (Optional[bool]) -- Reboot the machine if required by the uninstall
A dictionary containing the results of the command
CLI Example:
# Remove the KB5007575 just passing the number
salt '*' dism.remove_kb 5007575
# Remove the KB5007575 just passing the full name
salt '*' dism.remove_kb KB5007575
Uninstall a package
package (str) -- The full path to the package. Can be either a .cab file
or a folder. Should point to the original source of the package, not
to where the file is installed. This can also be the name of a
package as listed in dism.installed_packages
image (Optional[str]) -- The path to the root directory of an offline Windows image. If None is passed, the running operating system is targeted. Default is None.
restart (Optional[bool]) -- Reboot the machine if required by the uninstall
A dictionary containing the results of the command
CLI Example:
# Remove the Calc Package
salt '*' dism.remove_package Microsoft.Windows.Calc.Demo~6595b6144ccf1df~x86~en~1.0.0.0
# Remove the package.cab (does not remove C:\packages\package.cab)
salt '*' dism.remove_package C:\packages\package.cab