Files
ansible-project/execute_command_ps.yml
2025-11-06 13:08:47 +01:00

19 lines
421 B
YAML

---
- name: Execute Powershell Command
hosts: all
tasks:
- name: On execute la commande "{{ command }}"
ansible.windows.win_powershell:
script: "{{ command }}"
chdir: "{{ execution_path }}"
executable: pwsh.exe
arguments:
- -ExecutionPolicy
- ByPass
register: pwsh_output
failed_when:
- pwsh_output.output[0] != 7
- debug:
msg: "{{ pwsh_output }}"