Convert a batch-file command with complex arguments to PowerShell
问题 I have the following in .bat that is (this works): "%winscp%" /ini=nul ^ /log=C:\TEMP\winscplog.txt ^ /command "open scp://goofy:changeme@10.61.10.225/ -hostkey=""ssh-rsa 2048 d4:1c:1a:4c:c3:60:d5:05:12:02:d2:d8:d6:ae:6c:5d""" ^ "put ""%outfile%"" /home/public/somedir/somesubdir/%basename%" ^ "exit" I have tried to duplicate that into a powershell script like this: & $winscp "/ini=nul" ` "/log=C:\TEMP\winscplog.txt" ` "/command" 'open sftp://goofy:changeme@10.61.10.225/ -hostkey="ssh-rsa 2048