salt.modules.win_update

Module for running windows updates.

depends:
  • win32com
  • win32con
  • win32api
  • pywintypes

New in version 2014.7.0.

class salt.modules.win_update.PyWinUpdater(categories=None, skipUI=True, skipDownloaded=False, skipInstalled=True, skipReboot=False, skipPresent=False, softwareUpdates=True, driverUpdates=False, skipHidden=True)
AutoSearch()

this function generates a search string. simplifying the search function while still providing as many features as possible.

Download()
GetAvailableCategories()
GetCategories()
GetDownloadResults()
GetInstallationResults()

this gets results of installation process.

GetInstallationResultsPretty()

converts the installation results into a pretty print.

GetSearchResults()
GetSearchResultsPretty()
Install()
Search(searchString)
SetCategories(categories)
SetInclude(include, state)
SetIncludes(includes)
salt.modules.win_update.download_updates(includes=None, retries=5, categories=None)

Downloads all available updates, skipping those that require user interaction.

Various aspects of the updates can be included or excluded. this feature is still in development.

retries
Number of retries to make before giving up. This is total, not per step.
categories

Specify the categories to update. Must be passed as a list.

salt '*' win_update.download_updates categories="['Updates']"

Categories include the following:

  • Updates
  • Windows 7
  • Critical Updates
  • Security Updates
  • Update Rollups

CLI Examples:

# Normal Usage
salt '*' win_update.download_updates

# Download critical updates only
salt '*' win_update.download_updates categories="['Critical Updates']"
salt.modules.win_update.install_updates(includes=None, retries=5, categories=None)

Downloads and installs all available updates, skipping those that require user interaction.

Add cached to only install those updates which have already been downloaded.

you can set the maximum number of retries to n in the search process by adding: retries=n

various aspects of the updates can be included or excluded. This function is still under development.

retries
Number of retries to make before giving up. This is total, not per step.
categories

Specify the categories to install. Must be passed as a list.

salt '*' win_update.install_updates categories="['Updates']"

Categories include the following:

  • Updates
  • Windows 7
  • Critical Updates
  • Security Updates
  • Update Rollups

CLI Examples:

# Normal Usage
salt '*' win_update.install_updates

# Install all critical updates
salt '*' win_update.install_updates categories="['Critical Updates']"
salt.modules.win_update.list_updates(verbose=False, includes=None, retries=5, categories=None)

Returns a summary of available updates, grouped into their non-mutually exclusive categories.

verbose
Print results in greater detail
retries
Number of retries to make before giving up. This is total, not per step.
categories

Specify the categories to list. Must be passed as a list.

salt '*' win_update.list_updates categories="['Updates']"

Categories include the following:

  • Updates
  • Windows 7
  • Critical Updates
  • Security Updates
  • Update Rollups

CLI Examples:

# Normal Usage
salt '*' win_update.list_updates

# List all critical updates list in verbose detail
salt '*' win_update.list_updates categories=['Critical Updates'] verbose=True