【发布时间】:2016-09-16 06:05:09
【问题描述】:
我是 VisualSVN PowerShell 的新手。打开 PowerShell 本身时出现以下错误。
一元运算符“-”后缺少表达式。 在行:1 字符:2 + -E如果我使用任何 Visual SVN Server cmdlet,我会收到一条错误消息,指出它不能被识别为 cmdlet。请帮忙。
编辑:
ShortcutStartup.ps1包含以下代码。$Host.UI.RawUI.WindowTitle = "VisualSVN Server PowerShell" # Configure execution policy Set-ExecutionPolicy -Scope Process Undefined -Force if ($(Get-ExecutionPolicy) -eq "Restricted") { Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force } $env:Path = (Join-Path (Split-Path $MyInvocation.MyCommand.Path -Parent) "bin") + ";" + $env:Path # Check PowerShell version $major = 0 if (Test-Path variable:global:PSVersionTable) { $major = $PSVersionTable.PSVersion.Major } if ($major -lt 3) { Write-Warning "VisualSVN Server PowerShell module requires Windows PowerShell 3.0 or later." exit } Write-Host "" Write-Host " Welcome to VisualSVN Server PowerShell!" Write-Host "" Write-Host " List of VisualSVN Server cmdlets: " -NoNewline Write-Host "Get-Command -Module VisualSVN " -ForegroundColor Yellow Write-Host " Get help for a cmdlet: " -NoNewline Write-Host "help <cmdlet-name> " -NoNewline -ForegroundColor Yellow Write-Host "or " -NoNewline Write-Host "<cmdlet-name> -? " -ForegroundColor Yellow Write-Host " Get online help for a cmdlet: " -NoNewline Write-Host "help <cmdlet-name> -Online " -ForegroundColor Yellow Write-Host ""
【问题讨论】:
-
路径“C:\Program Files ....”周围缺少引号
-
@DavidBrabant 我刚刚从“C:\Program Files (x86)\VisualSVN Server”目录打开了“VisualSVNServerShell.exe”。没有输入任何命令。打开exe后我立即收到这些错误。我不确定在哪里添加引号。
-
@TessellatingHeckler。我已将 'C:\Program Files (x86)\VisualSVN Server\ShortcutStartup.ps1' 中的代码添加到原始帖子中。谢谢。
-
这看起来像是 VisualSVN 服务器中的一个错误。我建议您将其报告给support@visualsvn.com
-
您的操作系统和 VisualSVN 服务器版本是什么?我刚刚在 Windows Server 2012 R2 上使用 VisualSVN Server 3.5.4 Standard 进行了测试,结果符合预期。
标签: powershell svn visualsvn-server visualsvn