Debian Codegraph @

test/integration/targets/powershell-posix-target/tasks/main.yml

raw
1 - name: Find pwsh on PATH
2 command: which pwsh
3 register: pwsh_location
4 ignore_errors: yes
5
6 - when: pwsh_location is success
7 block:
8 - name: Get pwsh version
9 command: "{{ pwsh_location.stdout | trim | quote }} --version"
10 register: pwsh_version
11
12 - name: Show pwsh location and version
13 debug:
14 msg: "{{ pwsh_location.stdout | trim }} is {{ pwsh_version.stdout | trim }}"
15
16 - when: ansible_pwsh_interpreter is defined
17 block:
18 - name: Get ansible_pwsh_interpreter version
19 command: "{{ ansible_pwsh_interpreter | quote }} --version"
20 register: ansible_pwsh_interpreter_version
21
22 - name: Show ansible_pwsh_interpreter location and version
23 debug:
24 msg: "{{ ansible_pwsh_interpreter }} is {{ ansible_pwsh_interpreter_version.stdout | trim }}"