这是我的部署自动化脚本的一部分:
$SVNEXE = "$env:ProgramFiles\TortoiseSVN\bin\svn.exe"
foreach ($element in $commandstoken) {
#$exportfile = [System.Web.HttpUtility]::UrlPathDecode($StreamServe5RepoURI + $commandstoken[$a])
$exportfile = ($StreamServe5RepoURI + $commandstoken[$a])
$SVNRevision = $commandstoken[$a+1]
[string]$SVNCommand = "export -r $SVNRevision --force"
Write-Host -ForegroundColor Red $SVNCommand
Write-Host -ForegroundColor Red $SVNCommand $exportfile
&"$SVNEXE" $SVNCommand $exportfile "C:\Temp\__foo\export"
$a = $a+2
}
我想将$SVNCommand
变量传递给 svn.exe,但 svn.exe 抛出错误:svn.exe : Unknown subcommand: 'export -r 2384 --force'
据我所知,变量扩展正在工作,所以我不明白为什么会svn.exe
抛出这个错误。