kaxil commented on code in PR #73352:
URL: https://github.com/apache/airflow/pull/73352#discussion_r4462758928


##########
providers/ssh/src/airflow/providers/ssh/utils/remote_job.py:
##########
@@ -271,37 +271,43 @@ def build_windows_wrapper_command(
             env_setup += f"$env:{key} = '{escaped_value}'; "
 
     def ps_escape(s: str) -> str:
+        return s.replace("`", "``").replace('"', '`"')
+
+    def ps_escape_sq(s: str) -> str:
         return s.replace("'", "''")
 
     job_dir = ps_escape(paths.job_dir)
-    log_file = ps_escape(paths.log_file)
-    exit_code_file = ps_escape(paths.exit_code_file)
-    exit_code_tmp = ps_escape(paths.exit_code_tmp_file)
-    pid_file = ps_escape(paths.pid_file)
-    status_file = ps_escape(paths.status_file)
+    sep = paths.sep
+    job_id = ps_escape_sq(paths.job_id)
     escaped_command = ps_escape(command)

Review Comment:
   Fixed in c1bccb4: the command is now written to its own `cmd.ps1` as a 
quoted literal, so nothing in it is escaped. `python -c "print(1+1)"` and a 
`.ps1` given `--msg "hello world"` both run as written on windows-2022 and 
windows-latest.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to