From 2a414d60d26fe1f52f297defc76cbee0b5aa395f Mon Sep 17 00:00:00 2001 From: donotos Date: Thu, 6 Nov 2025 13:05:29 +0100 Subject: [PATCH] get rc powershell test6 --- execute_command_ps.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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