What command did you run and get a syntax error? Keep in mind that you are running in PowerShell on Windows. Mosh is probably using bash or zsh on macOS, and the commands may be different.
If you have the option to run the Windows Subsystem for Linux you may want to try that out. This lets you run a Linux OS on Windows, and it’s nice because the commands will be the same as what Mosh uses. If you go that route, make sure to install the “Remote - WSL” extension in VS Code.