我是Visual SVN PowerShell的新手。当我打开PowerShell本身时出现以下错误。Visual SVN Server PowerShell配置
Missing expression after unary operator '-'. At line:1 char:2 + -E <<<< xecutionPolicy Bypass -File C:\Program Files (x86)\VisualSVN Server\ShortcutStartup.ps1
如果我使用任何Visual SVN服务器的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后,我立即得到这些错误。我不确定在哪里添加引号。 – Venky
@TessellatingHeckler。我已将“C:\ Program Files(x86)\ VisualSVN Server \ ShortcutStartup.ps1”中的代码添加到原始帖子中。谢谢。 – Venky