我是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