I am trying to run a Powershell command in my C# program but I get the error
the term is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I even copied this same exact command in Powershell manually and it worked.
The code follows as
PowerShell ps = PowerShell.Create();
var cmd = "scp -i \"path\\to\\ssh_key\" \"path\\to\\source_file\" [email protected]:/data/user_storage";
ps.AddCommand(cmd);
ps.Invoke();