gpt4 book ai didi

powershell - VisualSVN Server PowerShell配置

转载 作者:行者123 更新时间:2023-12-02 23:57:42 30 4
gpt4 key购买 nike

我是VisualSVN PowerShell的新手。打开PowerShell本身时出现以下错误。

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 ""

最佳答案

VisualSVN Server PowerShell module需要PowerShell 3.0或更高版本。但是,您在Windows Server 2008上运行PowerShell 1.0。

PowerShell控制台未显示有关不受支持的PowerShell版本的警告是一个错误。不过,它针对PowerShell 2.0进行了显示。我将提交一个错误,我们将对其进行修复。

您可以按照MSDN | Installing Windows PowerShell on Windows Server 2008中指定的步骤在此服务器计算机上升级PowerShell。

感谢您的报告。

关于powershell - VisualSVN Server PowerShell配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39524707/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com