# salt.states.win_dism

## Installing of Windows features using DISM

Install windows features/capabilties with DISM

    Language.Basic~~~en-US~0.0.1.0:
      dism.capability_installed

    NetFx3:
      dism.feature_installed

salt.states.win_dism.capability_installed(name, source=None, limit_access=False, image=None, restart=False)

  Install a DISM capability

  Parameters:

    - 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~~~~

salt.states.win_dism.capability_removed(name, image=None, restart=False)

  Uninstall a DISM capability

  Parameters:

    - name (str) -- The capability to uninstall

    - 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.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~~~~

salt.states.win_dism.feature_installed(name, package=None, source=None, limit_access=False, enable_parent=False, image=None, restart=False)

  Install a DISM feature

  Parameters:

    - 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

salt.states.win_dism.feature_removed(name, remove_payload=False, image=None, restart=False)

  Disables a feature.

  Parameters:

    - 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 install

  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

salt.states.win_dism.package_installed(name, ignore_check=False, prevent_pending=False, image=None, restart=False)

  Install a package.

  Parameters:

    - 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

salt.states.win_dism.package_removed(name, image=None, restart=False)

  Uninstall a package

  Parameters:

    - 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 install

  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