salt.modules.win_dism#
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.
- salt.modules.win_dism.add_capability(capability, source=None, limit_access=False, image=None, restart=False)#
Install a capability
- Parameters:
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 isNone.limit_access (
bool, optional) -- Prevent DISM from contacting Windows Update for the source package. Default isFalse.image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.restart (
bool, optional) -- Reboot the machine if required by the install. Default isFalse.
- Raises:
NotImplementedError -- For all versions of Windows that are not Windows 10 and later. Server editions of Windows use ServerManager instead.
- Returns:
A dictionary containing the results of the command
- Return type:
CLI Example:
salt '*' dism.add_capability 'Tools.Graphics.DirectX~~~~0.0.1.0'
- salt.modules.win_dism.add_feature(feature, package=None, source=None, limit_access=False, enable_parent=False, image=None, restart=False)#
Install a feature using DISM
- Parameters:
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 isNone.source (
str, optional) -- The optional source of the capability. Default is set by group policy and can be Windows Update. Default isNone.limit_access (
bool, optional) -- Prevent DISM from contacting Windows Update for the source package. Default isFalse.enable_parent (
bool, optional) --Truewill enable all parent features of the specified feature. Default isFalse.image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.restart (
bool, optional) -- Reboot the machine if required by the install. Default isFalse.
- Returns:
A dictionary containing the results of the command
- Return type:
CLI Example:
salt '*' dism.add_feature 'NetFx3'
- salt.modules.win_dism.add_package(package, ignore_check=False, prevent_pending=False, image=None, restart=False)#
Install a package using DISM
- Parameters:
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 isFalse.prevent_pending (
bool, optional) -- Skip the installation of the package if there are pending online actions. Default isFalse.image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.restart (
bool, optional) -- Reboot the machine if required by the install. Default isFalse.
- Returns:
A dictionary containing the results of the command
- Return type:
CLI Example:
salt '*' dism.add_package 'C:\Packages\package.cab'
- salt.modules.win_dism.add_provisioned_package(package, image=None, restart=False)#
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.
- Parameters:
package (str) --
The package to install. Can be one of the following:
.appxor.appxbundle.msixor.msixbundle.ppkg
image (Optional[str]) -- The path to the root directory of an offline Windows image. If
Noneis passed, the running operating system is targeted. Default isNone.restart (Optional[bool]) -- Reboot the machine if required by the installation. Default is
False
- Returns:
A dictionary containing the results of the command
- Return type:
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
- salt.modules.win_dism.available_capabilities(image=None)#
List the capabilities available on the system
- Parameters:
image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.- Raises:
NotImplementedError -- For all versions of Windows that are not Windows 10
and later. Server editions of Windows use ServerManager instead. --
- Returns:
A list of available capabilities
- Return type:
CLI Example:
salt '*' dism.installed_capabilities
- salt.modules.win_dism.available_features(image=None)#
List the features available on the system
- Parameters:
image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.- Returns:
A list of available features
- Return type:
CLI Example:
salt '*' dism.available_features
- salt.modules.win_dism.get_capabilities(image=None)#
List all capabilities on the system
- Parameters:
image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.- Raises:
NotImplementedError -- For all versions of Windows that are not Windows 10
and later. Server editions of Windows use ServerManager instead. --
- Returns:
A list of capabilities
- Return type:
CLI Example:
salt '*' dism.get_capabilities
- salt.modules.win_dism.get_features(package=None, image=None)#
List features on the system or in a package
- Parameters:
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_packagesDefault is
None.image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.
- Returns:
A list of features
- Return type:
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'
- salt.modules.win_dism.get_kb_package_name(kb, image=None)#
Get the actual package name on the system based on the KB name.
New in version 3006.0.
- Parameters:
- Returns:
The name of the package found on the system None: If the package is not installed on the system
- Return type:
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
- salt.modules.win_dism.installed_capabilities(image=None)#
List the capabilities installed on the system
- Parameters:
image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.- Raises:
NotImplementedError -- For all versions of Windows that are not Windows 10
and later. Server editions of Windows use ServerManager instead. --
- Returns:
A list of installed capabilities
- Return type:
CLI Example:
salt '*' dism.installed_capabilities
- salt.modules.win_dism.installed_features(image=None)#
List the features installed on the system
- Parameters:
image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.- Returns:
A list of installed features
- Return type:
CLI Example:
salt '*' dism.installed_features
- salt.modules.win_dism.installed_packages(image=None)#
List the packages installed on the system
- Parameters:
image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.- Returns:
A list of installed packages
- Return type:
CLI Example:
salt '*' dism.installed_packages
- salt.modules.win_dism.package_info(package, image=None)#
Display information about a package
- Parameters:
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. IfNoneis passed, the running operating system is targeted. Default isNone.
- Returns:
A dictionary containing the results of the command
- Return type:
CLI Example:
salt '*' dism. package_info 'C:\packages\package.cab'
- salt.modules.win_dism.provisioned_packages(image=None)#
List the packages installed on the system
New in version 3007.0.
- Parameters:
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.
- Returns:
A list of installed packages
- Return type:
CLI Example:
salt '*' dism.installed_packages
- salt.modules.win_dism.remove_capability(capability, image=None, restart=False)#
Uninstall a capability
- Parameters:
capability (str) -- The capability to be removed
image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.restart (
bool, optional) -- Reboot the machine if required by the install. Default isFalse.
- Raises:
NotImplementedError -- For all versions of Windows that are not Windows 10
and later. Server editions of Windows use ServerManager instead. --
- Returns:
A dictionary containing the results of the command
- Return type:
CLI Example:
salt '*' dism.remove_capability 'Tools.Graphics.DirectX~~~~0.0.1.0'
- salt.modules.win_dism.remove_feature(feature, remove_payload=False, image=None, restart=False)#
Disables the feature.
- Parameters:
feature (str) -- The feature to uninstall.
remove_payload (
bool, optional) -- Remove the feature's payload. Must supply source when enabling in the future. Default isFalse.image (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.restart (
bool, optional) -- Reboot the machine if required by the install. Default isFalse.
- Returns:
A dictionary containing the results of the command
- Return type:
CLI Example:
salt '*' dism.remove_feature 'NetFx3'
- salt.modules.win_dism.remove_kb(kb, image=None, restart=False)#
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_packagefunction to remove the package.New in version 3006.0.
- Parameters:
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. IfNoneis passed, the running operating system is targeted. Default isNone.restart (
bool, optional) -- Reboot the machine if required by the uninstall. Default isFalse.
- Returns:
A dictionary containing the results of the command
- Return type:
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
- salt.modules.win_dism.remove_package(package, image=None, restart=False)#
Uninstall a package
- Parameters:
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_packagesimage (
str, optional) -- The path to the root directory of an offline Windows image. IfNoneis passed, the running operating system is targeted. Default isNone.restart (
bool, optional) -- Reboot the machine if required by the uninstall. Default isFalse.
- Returns:
A dictionary containing the results of the command
- Return type:
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'