I'm using PowerShell to remotely issue a command on a Linux server. I'm using plink to connect to the server.
However plink strips out double quotes in the commands I want to run. This stops those commands from working.
$user = "user"
$password = "password"
$hostname = "host"
$plinkPath = gci -Recurse | Where-Object {$_.Name -eq "plink.exe"} | select -First 1 | foreach{$_.FullName}
& $plinkPath "$User@$hostname" -pw $password "echo" "hello ab`"cdef world"
This gives the result
hello abcdef world
It lost the speech marks in between the 'b' and the 'c'.
How do I fix this?