diff --git a/execute_command_ps.yml b/execute_command_ps.yml index a76d8fa..d981511 100644 --- a/execute_command_ps.yml +++ b/execute_command_ps.yml @@ -5,10 +5,15 @@ tasks: - name: On execute la commande "{{ command }}" - ansible.windows.win_shell: "{{ powershell_path }} {{ command }}" - args: + ansible.windows.win_powershell: + script: "{{ command }}" chdir: "{{ execution_path }}" - register: ps_script - + executable: pwsh.exe + arguments: + - -ExecutionPolicy + - ByPass + register: pwsh_output + failed_when: + - pwsh_output.output[0] != 7 - debug: - msg: "{{ ps_script }}" \ No newline at end of file + msg: "{{ pwsh_output }}" \ No newline at end of file