0

I'm doing a Powershell script which will call a svn command to relocate a repo. The command will look like this:

$newurl = "https://pathtonewurl"
Invoke-Expression -Command "svn relocate $newurl --username 'user' --password 'password'"

When running, I get: Missing expression after unary operator '--'. How can I use --parameter in an expression ?

1
  • 1
    You should now use Invoke-Expression for such a purpose. Instead you can use the stop parsing symbol (--%) of PowerShell. Here you can read more: Stop Parsing on ss64.com and About Parsing Commented Apr 5, 2021 at 7:31

1 Answer 1

1

Since svn isn't a powershell command, use Start-Process instead:

Start-Process svn -ArgumentList "relocate $newurl --username 'user' --password 'password'"

Or try the call operator &: How to use SVN-commit in powershell

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.