salt.modules.win_wusa

Microsoft Update files management via wusa.exe

maintainer

Thomas Lemarchand

platform

Windows

depends

PowerShell

New in version 2018.3.4.

salt.modules.win_wusa.install(path, restart=False)

Install a KB from a .msu file.

Parameters
  • path (str) -- The full path to the msu file to install

  • restart (bool) -- True to force a restart if required by the installation. Adds the /forcerestart switch to the wusa.exe command. False will add the /norestart switch instead. Default is False

Returns

True if successful, otherwise False

Return type

bool

Raise:
CommandExecutionError: If the package is already installed or an error

is encountered

CLI Example:

salt '*' wusa.install C:/temp/KB123456.msu
salt.modules.win_wusa.is_installed(name)

Check if a specific KB is installed.

Parameters

name (str) -- The name of the KB to check

Returns

True if installed, otherwise False

Return type

bool

CLI Example:

salt '*' wusa.is_installed KB123456
salt.modules.win_wusa.list()

Get a list of updates installed on the machine

Returns

A list of installed updates

Return type

list

CLI Example:

salt '*' wusa.list
salt.modules.win_wusa.uninstall(path, restart=False)

Uninstall a specific KB.

Parameters
  • path (str) -- The full path to the msu file to uninstall. This can also be just the name of the KB to uninstall

  • restart (bool) -- True to force a restart if required by the installation. Adds the /forcerestart switch to the wusa.exe command. False will add the /norestart switch instead. Default is False

Returns

True if successful, otherwise False

Return type

bool

Raises

CommandExecutionError -- If an error is encountered

CLI Example:

salt '*' wusa.uninstall KB123456

# or

salt '*' wusa.uninstall C:/temp/KB123456.msu