community.windows.win_file_version (2.2.0) — module

Get DLL or EXE file build version

Authors: Sam Liu (@SamLiu79)

Install collection

Install with ansible-galaxy collection install community.windows:==2.2.0


Add to requirements.yml

  collections:
    - name: community.windows
      version: 2.2.0

Description

Get DLL or EXE file build version.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get acm instance version
  community.windows.win_file_version:
    path: C:\Windows\System32\cmd.exe
  register: exe_file_version
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    msg: '{{ exe_file_version }}'

Inputs

    
path:
    description:
    - File to get version.
    - Always provide absolute path.
    required: true
    type: path

Outputs

file_build_part:
  description: build number of the file.
  returned: no error
  type: str
file_major_part:
  description: the major part of the version number.
  returned: no error
  type: str
file_minor_part:
  description: the minor part of the version number of the file.
  returned: no error
  type: str
file_private_part:
  description: file private part number.
  returned: no error
  type: str
file_version:
  description: File version number..
  returned: no error
  type: str
path:
  description: file path
  returned: always
  type: str
product_version:
  description: The version of the product this file is distributed with.
  returned: no error
  type: str

See also