PowerShell “You must provide a value expression following the ‘/’ operator” error when calling WinSCP.com

Question:

I have a piece of code that puts a file into an FTP server. Looks like this:

This runs fine in the Windows command prompt, but when running the same thing in PowerShell it doesn’t work and returns me the following error:

“You must provide a value expression following the ‘/’ operator”

I’ve tried a few combinations of my code but none of them worked:

1)

2)

Answer:

Since the path and/or filename of the winscp.com executable contains whitespace, invoke it with the & operator:

(assuming the command-line arguments to winscp.com are otherwise correct, of course)

Source:

PowerShell “You must provide a value expression following the ‘/’ operator” error when calling WinSCP.com by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply