ansible / ansible.builtin / v2.7.17 / module / win_pester Run Pester tests on Windows hosts | "added in version" 2.6 of ansible.builtin" Authors: Erwan Quelin (@erwanquelin) preview | supported by communityansible.builtin.win_pester (v2.7.17) — module
pip
Install with pip install ansible==2.7.17
Run Pester tests on Windows hosts.
Test files have to be available on the remote host.
- name: Get facts setup:
- name: Add Pester module action: module_name: "{{ 'win_psmodule' if ansible_powershell_version >= 5 else 'win_chocolatey' }}" name: Pester state: present
- name: Run the pester test provided in the path parameter. win_pester: path: C:\Pester
# Run pesters tests files that are present in the specified folder # ensure that the pester module version available is greater or equal to the version parameter. - name: Run the pester test present in a folder and check the Pester module version. win_pester: path: C:\Pester\test01.test.ps1 version: 4.1.0
path: description: - Path to a pester test file or a folder where tests can be found. - If the path is a folder, the module will consider all ps1 files as Pester tests. required: true version: description: - Minimum version of the pester module that has to be available on the remote host.
output: description: Results of the Pester tests. returned: success sample: false type: list pester_version: description: Version of the pester module found on the remote host. returned: always sample: 4.3.1 type: string