尝试使用 powershell 脚本自动化我早上更新多个颠覆工作副本的习惯。svn更新工作正常,但最好挂接到SvnUpdateResult以显示更改或任何冲突。
我已经为更新结果指定了输出参数,但不确定如何克服模棱两可的重载异常?我已经指定了参数类型:
try {
Add-Type -Path "C:\Program Files\SharpSVN\SharpSvn.dll"
}
catch [System.BadImageFormatException] {
Write-Host "LFMF: You're probably using 32bit SharpSVN.dll in 64bit powershell ;-)"
}
$paths = @("Project-Trunk", "Project-Branch");
$currentPath = (Get-Location).Path
$svnClient = New-Object SharpSvn.SvnClient
foreach ($path in $paths) {
Write-Host "Updating" $path
$svnLocalPath = Join-Path $currentPath $path;
# Throws: Multiple ambiguous overloads found for "Update" and the argument count: "2".
$svnClient.Update([string]$svnLocalPath, [ref][SharpSvn.SvnUpdateResult]$result)
}
我很感激我可以只使用 svn 客户端或 tortoiseproc,但我正在尝试了解有关 powershell 的更多信息。