.. versionadded:: 2017.7.0

    Uninstall updates.

    Args:

        names (str, list):
            A single update or a list of updates to uninstall. This can be any
            combination of GUIDs, KB numbers, or names. GUIDs or KBs are
            preferred.

    Returns:

        dict: A dictionary containing the details about the uninstalled updates

    CLI Examples:

    .. code-block:: bash

        # Normal Usage
        salt '*' win_wua.uninstall KB3121212

        # As a list
        salt '*' win_wua.uninstall guid=['12345678-abcd-1234-abcd-1234567890ab', 'KB1231231']

def uninstall(names):
    '''
    .. versionadded:: 2017.7.0

    Uninstall updates.

    Args:

        names (str, list):
            A single update or a list of updates to uninstall. This can be any
            combination of GUIDs, KB numbers, or names. GUIDs or KBs are
            preferred.

    Returns:

        dict: A dictionary containing the details about the uninstalled updates

    CLI Examples:

    .. code-block:: bash

        # Normal Usage
        salt '*' win_wua.uninstall KB3121212

        # As a list
        salt '*' win_wua.uninstall guid=['12345678-abcd-1234-abcd-1234567890ab', 'KB1231231']
    '''
    # Create a Windows Update Agent instance
    wua = salt.utils.win_update.WindowsUpdateAgent()

    # Search for Updates
    updates = wua.search(names)

    if updates.count() == 0:
        raise CommandExecutionError('No updates found')

    return wua.uninstall(updates)