Question

I want to create the VisualSVN Server repository and get that repository URL in command prompt. I need only that URL not any other information. can anyone help me?

I need command equal to VisualSVN Servers New->Repository and Copy URL to clipboard.

Était-ce utile?

La solution

Update 2016:

Upgrade to the latest VisualSVN Server version that includes a PowerShell module that adds a number of PowerShell cmdlets for Subverion server and repository administrators. Read VisualSVN Server | Scripting and Automation page.

The cmdlets should be very helpful in regular administration tasks and automation. Here is the complete list of VisualSVN Server PowerShell cmdlets: KB88: VisualSVN Server PowerShell Cmdlet Reference.

As @IvanZhakov already suggested, you can create a new repository using New-SvnRepository cmdlet.

Here is an example of creating a new repository MyRepository and grabbing its URL parameter:

$repo = New-SvnRepository -Name MyRepository
$repo.URL

Outdated answer:

I assume you mean VisualSVN Server, not VisualSVN extension for Visual Studio.

  • You can create a repository with svnadmin create command or using VisualSVN Server's WMI (Windows Management Instrumentation) provider. Here is the PowerShell command that creates a new repository "Repo1":

    Invoke-WmiMethod -namespace root\VisualSVN -class VisualSVN_Repository -Name Create -ArgumentList Repo1

  • You can get URL of repository "Repo1" with the following PowerShell command:

    Get-WmiObject -namespace root\VisualSVN -class VisualSVN_Repository | Select-Object -expandproperty URL | Select-String -SimpleMatch "Repo1"

If you want to explore VisualSVN Server WMI provider, you can check it's MOF file which is located in the following folder "%VISUALSVN_SERVER%\WMI" on the computer where VisualSVN Server installed. Using this file as a reference you can write a program to manage VisualSVN Server on a various programming languages.

You may also want to check the MSDN article "Using WMI".

Autres conseils

It's very easy with latest VisualSVN Server 3.4.0: it includes Powershell module for managing Subversion server. Just run PowerShell 3.0 and execute the following command:

$repo = New-SvnRepository -Name repo
$repo.URL

You may use Get-Command -Module VisualSVN to get list of all VisualSVN Server cmdlets.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top