[英]PowerShell SharpSvn Certificate issue?
我正在尝试使用PowerShell 2.0和SharpSVN 1.7从SVN进行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)
$svnClient.Authentication.add_SslServerTrustHandlers({
$_.AcceptedFailures = $_.Failures
$_.Save = $True
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.