diff --git a/crates/remote/src/transport/ssh.rs b/crates/remote/src/transport/ssh.rs index ee68435eb6e90497b4982dbf47aef07335a8d1bd..a7aa7e08e6b75c32211d7b06ed82498deb03e175 100644 --- a/crates/remote/src/transport/ssh.rs +++ b/crates/remote/src/transport/ssh.rs @@ -945,9 +945,15 @@ impl SshRemoteConnection { .try_quote(&orig_tmp_path) .context("shell quoting")?; let tmp_path = shell_kind.try_quote(tmp_path).context("shell quoting")?; + let tmp_exe_path = format!("{tmp_path}\\remote_server.exe"); + let tmp_exe_path = shell_kind + .try_quote(&tmp_exe_path) + .context("shell quoting")?; format!( "Expand-Archive -Force -Path {orig_tmp_path} -DestinationPath {tmp_path} -ErrorAction Stop; - Move-Item -Force {tmp_path} {dst_path}", + Move-Item -Force {tmp_exe_path} {dst_path}; + Remove-Item -Force {tmp_path} -Recurse; + Remove-Item -Force {orig_tmp_path}", ) } else { let orig_tmp_path = shell_kind