I am trying to pass a variable to a windows SSH server. For some reason it is not reading it and giving me a "The specified path is invalid." error. The code I am running is
$filepath="C:\\temp"
ssh user@server "dir /b $filepath"
With unix I am able to pass a variable this way, but I am not sure why it does not work with windows. Thanks!
Just use c:\temp
instead of c:\\temp
and make sure the folder exists