2

I am trying to automate a procedure that uses SVN, and I am trying to teach myself PowerShell (and scripting) in the process.

I set up a PowerShell script that reads values for revision numbers and my folder path, like this:

$GetSVN = read-host "Enter the SVN folder path: "
$RevStart = read-host "Enter the starting revision: "
$RevEnd   = read-host "Enter the ending revision: "

It then calls SVN and (tries to) pass the parameters.

Here's my problem: When I try to call SVN as follows:

& "c:\Program Files\TortoiseSVN\bin\svn.exe" "-log -r $RevStart`:$RevEnd  $GetSVN"

I get the following message:

svn: E205000: Non-numeric limit argument given
svn: E200004: Could not convert 'og -r BASE:#### [SVN file path]' into a number

Okay, fine. I tried adding an extra space before "-log". But when I do that, here's what happens:

Unknown subcommand: ' -log -r BASE:#### [SVN file path]'

Huh?!? What's going on with this? I've tried various variations of this, all to no avail. I can't find an answer to this anywhere. Does anyone have any insight?

I am a newbie to PowerShell scripting, so feel free to answer as such.

Thanks in advance . . .

1 Answer 1

4

Your call is wrong, multiple parameters are grouped as one. Better and correct way to do it is this:

set-alias svn "c:\Program Files\TortoiseSVN\bin\svn.exe" 
svn log -r $RevStart`:$RevEnd $GetSVN

Setting alias is cosmetics. The real problem were " placement.

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

1 Comment

Never mind, got it! It did work, but the problem was that I was putting the "-" before "log" (I forgot that this was invalid syntax).

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.