首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PowerShell SharpSvn证书问题?

PowerShell SharpSvn证书问题?
EN

Stack Overflow用户
提问于 2013-11-26 04:26:39
回答 1查看 284关注 0票数 0

我正在尝试使用PowerShell 2.0和SharpSVN 1.7从svn结帐或更新?

当我在Powershell之外运行TortoiseSVN时,我得到了一个证书错误,并且必须点击接受,然后我就连接上了。在使用SharpSvn的PowerShell中,我得到以下错误:

代码语言:javascript
复制
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中如何做到这一点

这是代码片段-感谢您的帮助

代码语言:javascript
复制
[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) 
EN

回答 1

Stack Overflow用户

发布于 2014-01-08 05:05:03

代码语言:javascript
复制
$svnClient.Authentication.add_SslServerTrustHandlers({
        $_.AcceptedFailures = $_.Failures
        $_.Save = $True
    })
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20202604

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档