I am new to VisualSVN PowerShell. I am getting the following error when I open the PowerShell itself.
Missing expression after unary operator '-'. At line:1 char:2 + -E <<<< xecutionPolicy Bypass -File C:\Program Files (x86)\VisualSVN Server\ShortcutStartup.ps1
If I use any Visual SVN Server cmdlets I am getting an error saying it is not recognized as a cmdlet. Please help.
EDIT:
ShortcutStartup.ps1 contains the following code.
$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 ""