My local machine has Windows OS. My remote machine has Linux OS. I'm trying to run some bash commands on the remote machine from my local machine (with the use of ssh). In the powershell script below I'm feeding a multiline comment to stdin input of ssh client. The code does not work and gives me an error. The problem is that each line passed to bash has \r (carriage return symbol) appended to it and bash interprets it as a part of a command. What are my options here?
Powershell script
ssh -tt "$Username@$Host" @"
cd /home/someuser/project
cd ~
"@
Bash error
bash: line 0: cd: $'/home/someuser/project\r': No such file or directory
@"..."@ -replace "`r`n", "`n"for instance (I guess it won't convert the last line however)