我正在尝试使用PowerShell 2.0和SharpSVN 1.7从svn结帐或更新?
当我在Powershell之外运行TortoiseSVN时,我得到了一个证书错误,并且必须点击接受,然后我就连接上了。在使用SharpSvn的PowerShell中,我得到以下错误:
Exception calling "CheckOut" with "2" argument(s): "Unable to connect to a repository at URL '...'"
At Z:\Temp\SVNTEST\svntest.ps1:64 char:20
+ $svnClient.CheckOut <<<< ($repoUri, $svnLocalPath)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException代码非常简单,有一些添加捕获错误并成功的异常处理程序的C#示例,我不确定这是否是我的问题,或者在PowerShell中如何做到这一点
这是代码片段-感谢您的帮助
[System.IO.Directory]::SetCurrentDirectory($currentScriptDirectory.Path)
$evidence = [System.Reflection.Assembly]::GetExecutingAssembly().Evidence
[Reflection.Assembly]::LoadFile(("...SharpSvn.dll"),$evidence)
$svnClient = new-object SharpSvn.SvnClient
$repoUri = new-object SharpSvn.SvnUriTarget($svnUrl)
$svnClient.Authentication.DefaultCredentials = New-Object System.Net.NetworkCredential($svnUsername,$svnPassword)
$svnClient.CheckOut($repoUri, $svnLocalPath) 发布于 2014-01-08 05:05:03
$svnClient.Authentication.add_SslServerTrustHandlers({
$_.AcceptedFailures = $_.Failures
$_.Save = $True
})https://stackoverflow.com/questions/20202604
复制相似问题