Install Windows features, capabilities, and packages with DISM
Language.Basic~~~en-US~0.0.1.0:
dism.capability_installed
NetFx3:
dism.feature_installed
Install a DISM capability
name (str) -- The capability to install
source (str) -- The optional source of the capability
limit_access (bool) -- Prevent DISM from contacting Windows Update for online images
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
Example
Run dism.available_capabilities
to get a list of available
capabilities. This will help you get the proper name to use
install_dotnet35:
dism.capability_installed:
- name: NetFX3~~~~
Uninstall a DISM capability
Example
Run dism.installed_capabilities
to get a list of installed
capabilities. This will help you get the proper name to use
remove_dotnet35:
dism.capability_removed:
- name: NetFX3~~~~
Install a DISM feature
name (str) -- The feature in which 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 (str) -- The optional source of the feature
limit_access (bool) -- Prevent DISM from contacting Windows Update for online images
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
Example
Run dism.available_features
to get a list of available features.
This will help you get the proper name to use
install_telnet_client:
dism.feature_installed:
- name: TelnetClient
Disables a feature.
name (str) -- The feature to disable
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 uninstall
Example
Run dism.installed_features
to get a list of installed features.
This will help you get the proper name to use
remove_telnet_client:
dism.feature_removed:
- name: TelnetClient
- remove_payload: True
Uninstall a KB package
New in version 3006.0.
name (str) -- The name of the KB. Can be with or without the KB at the beginning
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
Example
# Example using full KB name
remove_KB1231231:
dism.package_installed:
- name: KB1231231
# Example using just he KB number
remove_KB1231231:
dism.package_installed:
- name: 1231231
Install a package.
name (str) -- The package to install. Can be a .cab file, a .msu file, or a folder
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
Example
install_KB123123123:
dism.package_installed:
- name: C:\Packages\KB123123123.cab
Uninstall a package
name (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
Example
# Example using source
remove_KB1231231:
dism.package_installed:
- name: C:\Packages\KB1231231.cab
# Example using name from ``dism.installed_packages``
remove_KB1231231:
dism.package_installed:
- name: Package_for_KB1231231~31bf3856ad364e35~amd64~~10.0.1.3
Provision a package on a Windows image.
New in version 3007.0.
name (str) --
The package to install. Can be one of the following:
.appx
or .appxbundle
.msix
or .msixbundle
.ppkg
The name of the file before the file extension must match the name
of the package after it is installed. This name can be found by
running dism.provisioned_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 installation. Default is
False
Example
install_windows_media_player:
dism.provisioned_package_installed:
- name: C:\Packages\Microsoft.ZuneVideo_2019.22091.10036.0_neutral_~_8wekyb3d8bbwe.Msixbundle