def version(name, check_remote=False, source=None, pre_versions=False):
    choc_path = _find_chocolatey(__context__, __salt__)
    if not choc_path:
        err = 'Chocolatey not installed. Use chocolatey.bootstrap to install the Chocolatey package manager.'
        log.error(err)
        raise CommandExecutionError(err)

    cmd = [choc_path, 'list', name]
    if not salt.utils.is_true(check_remote):
        cmd.append('-LocalOnly')
    if salt.utils.is_true(pre_versions):
        cmd.append('-Prerelease')
    if source:
        cmd.extend(['-Source', source])

    result = __salt__['cmd.run_all'](cmd, python_shell=False)

    if result['retcode'] != 0:
        err = 'Running chocolatey failed: {0}'.format(result['stderr'])
        log.error(err)
        raise CommandExecutionError(err)

    ret = {}

    res = result['stdout'].split('\n')

    ver_re = re.compile(r'(\S+)\s+(.+)')
    for line in res:
        if 'packages found' not in line and 'packages installed' not in line:
            for name, ver in ver_re.findall(line):
                ret[name] = ver

    return ret
Instructs Chocolatey to check an installed package version, and optionally
dataset/ETHPy150Open saltstack/salt/salt/modules/chocolatey.py/version