PowerShell Scripting and Automation

VisualSVN Server includes a PowerShell module and adds a number of cmdlets that extend PowerShell to meet the needs of VisualSVN Server administrators.

VisualSVN Server PowerShell console

The PowerShell cmdlets help administrators automate routine and repetitive tasks as well as simplify the server and repository deployment tasks.

What is more, all VisualSVN Server PowerShell cmdlets support remote server administration.

Windows PowerShell is a powerful command-line shell and a scripting language that is included with Windows operating systems and is designed for system administrators. With the PowerShell module, VisualSVN Server adds a set of PowerShell cmdlets providing a wide range of VisualSVN Server and Subversion repositories management functionality.

Any of the operations can be combined, automated and performed in bulk turning complex multi-step tasks into simple PowerShell commands.

Automating routine tasks

VisualSVN Server PowerShell helps administrators automate routine tasks and avoid performing the same or similar tasks repeatedly. For example, administrators can assign or revoke user access permissions and create new project structures in the repositories through automation.

Here is a sample command that will create a new predefined project structure in a repository:

New-SvnRepositoryItem MyRepo /trunk, /tags, /branches -Type Folder

Performing bulk operations

VisualSVN Server PowerShell helps administrators perform bulk operations on hundreds of repositories in a matter of seconds. Any administrative operation can be done in bulk.

Here is a sample command that will verify the integrity of all Subversion repositories hosted on the VisualSVN Server instance:

Get-SvnRepository | Test-SvnRepository

Here is a sample command that will create 5 new repositories:

1..5 | % {New-SvnRepository -Name "MyRepo$_"}

Administrative reporting

VisualSVN Server PowerShell helps administrators generate and export administrative reports on repositories and access rules. The reports can be easily exported into any common file format such as CSV.

Here is a sample command that will retrieve and display all user access rules as a list:

Get-SvnAccessRule | Select Repository, Path, AccountName, Access

Getting Started with the VisualSVN Server PowerShell

The VisualSVN Server PowerShell module installs automatically and does not require any additional configuration steps. For more information, read the article KB165: Using VisualSVN Server PowerShell module. For the list of and more information on the cmdlets, read the article KB88: VisualSVN Server PowerShell Cmdlet Reference.

Read the article KB99: Configuring remote administration with VisualSVN Server PowerShell to start using the remote administration capabilities of the cmdlets.