Description
I've been working with the Posh-SSH PowerShell module, which uses this library, to transfer files to/from Cisco devices via SCP. With the Cisco devices as the SCP server. Currently testing with a 2801 router running IOS 12.4(24)T1.
We also have newer routers running 15.4 but I have not had chance to test one of those yet.
I've found that the Cisco scp process interprets the quotes added around the filename as part of the filename. If I remove the quotes the file transfer works as expected.
I changed...
channel.SendExecRequest(string.Format("scp -t {0}", pathOnly));
to ...
channel.SendExecRequest(string.Format("scp -t \"{0}\"", pathOnly));
It is also worth noting, I'm using the stream based overrides as the Cisco scp process doesn't support the "-p, -r or -d" options.
Is this something you would consider adding compatibility for? Would you like me to propose a solution in a pull request?