Updated: Subversion PowerShell Module

  • 4

Updated: Subversion PowerShell Module

In May 2014, I published a PowerShell Module in the TechNet Gallery. It has a five star rating after all based on four votes, LOL. Anyways, I revised that module in order to support pipeline processing and whatif. Furthermore, I decided to publish the Subversion module in the PowerShell Gallery

The Subversion Powershell Module provides a bunch of functions and aliases to work with Subversion/SVN working copies. It requires the Subversion command-line binary svn.exe.

  • Update-SvnWorkingCopy brings the latest changes (HEAD revision) from the repository into an existing working copy.
  • Publish-SvnWorkingCopy sends the changes from your working copy to the repository.
  • Import-SvnUnversionedFilePath commits an unversioned file or directory tree into the repository.
  • New-SvnWorkingCopy checks out a working copy from a repository (HEAD revision).
  • Get-SvnWorkingCopy returns the status of working copy files and directories.
  • Add-SvnWorkingCopyItem puts files and directories under version control, that is scheduling them for addition to repository in next commit.
  • Remove-SvnWorkingCopyItem removes files and directories from version control, that is scheduling them for deletion upon the next commit. (Items that have not been committed are immediately removed from the working copy.)
  • Repair-SvnWorkingCopy fixes a working copy that has been modified by non-svn commands in terms of file addition and removal. The function identifies items that are not under version control and items that are missing. It puts non-versioned items under version control, and it removes missing items from version control (i.e. schedule for deletion upon next commit).
  • Switch-SvnWorkingCopy updates the working copy to a different URL within the same repository.

The functions provide only basic functionality and work fine with the subversion command line client from http://www.collab.net/downloads/subversion


  • 0

Updated: PowerShell Subversion Module

Tags :

Category : Windows PowerShell

Yes, I know, these days Git is king of the hill. Anyways, I shared my PowerShell module for Subversion at PoshCode.org (see below) Microsoft TechNet Gallery. The module exposes a bunch of functions and aliases:

  • The function Update-SvnWorkingCopy is a wrapper for “svn.exe update” and brings the latest changes (HEAD revision) from the repository into an existing working copy.
  • The function Publish-SvnWorkingCopy is a wrapper for “svn.exe commit” and sends the changes from your working copy to the repository.
  • The function Import-SvnUnversionedFilePath is a wrapper for “svn.exe import” and commits an unversioned file or directory tree into the repository.
  • The function New-SvnWorkingCopy is a wrapper for “svn.exe checkout” and checks out a working copy from a repository (HEAD revision).
  • The function Get-SvnWorkingCopy is a wrapper for “svn.exe status” and returns the status of working copy files and directories
  • The function Add-SvnWorkingCopyItem is a wrapper for “svn.exe add” and puts files and directories under version control, that is scheduling them for addition to repository in next commit.
  • The function Remove-SvnWorkingCopyItem is a wrapper for “svn.exe delete” and removes files and directories from version control, this is scheduling them for deletion upon the next commit. (Items that have not been committed are immediately removed from the working copy.)
  • The function Repair-SvnWorkingCopy fixes a working copy that has been modified by non-svn commands in terms of file addition and removal. The function identifies items that are not under version control and items that are missing. It puts non-versioned items under version control, and it removes missing items from version control (i.e. schedule for deletion upon next commit).

Furthermore, it alters PowerShell’s Prompt function in order to display some information about the state of a SVN working copy