-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathPowerScript-SVN-Export
More file actions
38 lines (25 loc) · 860 Bytes
/
PowerScript-SVN-Export
File metadata and controls
38 lines (25 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Get param from SVN
$repos = $args[0]
$rev = $args[1]
# Get trailing dir name
$repodirname = Split-Path $repos -Leaf
# Build url to repository
$urepos = $repos -replace "\\", "/"
$urepos
$url = "file:///$urepos/"
# Destination Direcorty
$destination = "C:\websites-wp\" + $repodirname
$destination
# Clear Destination Direcorty (delete all files)
Remove-Item $destination\* -recurse
# Build path to svn.exe
$svn = "$env:VISUALSVN_SERVER\bin\svn.exe"
# SVN Export Command
&"$svn" export --force "$url" "$destination"
# Tracking Log
$path = "C:\temp\mylogfile.log"
add-content -Path $path -Value "repos $repos" -Force
add-content -Path $path -Value "rev $rev" -Force
add-content -Path $path -Value "repodirname $repodirname" -Force
add-content -Path $path -Value "url $url" -Force
add-content -Path $path -Value "destination $destination" -Force