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 (str
, optional) -- The optional source of the capability. Default is set by group
policy and can be Windows Update.
Default is None
.
limit_access (bool
, optional) -- Prevent DISM from contacting Windows Update for the source package.
Default is False
.
image (str
, optional) -- 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 (bool
, optional) -- Reboot the machine if required by the install.
Default is False
.
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 (str
, optional) -- 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.
Default is None
.
source (str
, optional) -- The optional source of the capability. Default is set by group
policy and can be Windows Update.
Default is None
.
limit_access (bool
, optional) -- Prevent DISM from contacting Windows Update for the source package.
Default is False
.
enable_parent (bool
, optional) -- True
will enable all parent features of the specified feature.
Default is False
.
image (str
, optional) -- 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 (bool
, optional) -- Reboot the machine if required by the install.
Default is False
.
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 (bool
, optional) -- Skip installation of the package if the applicability checks fail.
Default is False
.
prevent_pending (bool
, optional) -- Skip the installation of the package if there are pending online
actions. Default is False
.
image (str
, optional) -- 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 (bool
, optional) -- Reboot the machine if required by the install.
Default is False
.
A dictionary containing the results of the command
CLI Example:
salt '*' dism.add_package 'C:\Packages\package.cab'
List the capabilities available on the system
image (str
, optional) -- 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 (str
, optional) -- 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 (str
, optional) -- 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 (str
, optional) --
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
Default is None
.
image (str
, optional) -- 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 (str
, optional) -- 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 (str
, optional) -- 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 (str
, optional) -- 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 (str
, optional) -- 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'
Uninstall a capability
capability (str) -- The capability to be removed
image (str
, optional) -- 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 (bool
, optional) -- Reboot the machine if required by the install.
Default is False
.
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 (bool
, optional) -- Remove the feature's payload. Must supply source when enabling in
the future.
Default is False
.
image (str
, optional) -- 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 (bool
, optional) -- Reboot the machine if required by the install.
Default is False
.
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 (str
, optional) -- 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 (bool
, optional) -- Reboot the machine if required by the uninstall. Default is
False
.
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 (str
, optional) -- 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 (bool
, optional) -- Reboot the machine if required by the uninstall.
Default is False
.
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'