PoshCode Archive  Artifact [3ec5c73d43]

Artifact 3ec5c73d43499b4e8cb7c6b94b803a89caad1ed85728eaf48382782997ba25fd:

  • File Add-SVNFile.ps1 — part of check-in [949c3cc0e7] at 2018-06-10 13:33:37 on branch trunk — Upload bucnh of files to SVN repository (user: benduru size: 1155)

# encoding: utf-8
# api: powershell
# title: Add-SVNFile
# description: Upload bucnh of files to SVN repository
# version: 1.81
# type: script
# author: benduru
# license: CC0
# x-poshcode-id: 3961
# x-archived: 2014-10-13T03:02:07
# x-published: 2014-02-18T21:17:00
#
# Script not tested.. just a req from someone
#
funtcion Add-SVNFile {
    # Usage Get-Childitem C:\Scripts\ | Add-SVNFile -Uri https://svn.internal.foo.com/svn/mycoolgame/branches/1.81 -Comment "Not sure if it's working"
    param (
        [Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$true)]
        [String[]]$File,
        [Parameter(Position=1,Mandatory=$true)]
        [String]$Uri, #Ton dépot SVN ex: https://svn.internal.foo.com/svn/mycoolgame/branches/1.81
        [Parameter(Position=2,Mandatory=$true)]
        [String]$Comment = "Nothing"
    )

    Start-Process -Filepath "svn.exe" -ArgumentList "co $uri" -Wait -WindowStyle Hidden
    Start-Process -Filepath "svn.exe" -ArgumentList "add $File" -Wait -WindowStyle Hidden
    Start-Process -Filepath "svn.exe" -ArgumentList "ci -m $Comment $File" -Wait -WindowStyle Hidden

}