2015-09-25 84 views
0

我目前使用PoSH服務器在我的服務器上託管一個小型統計應用(僅用於amdin使用)。安裝SQL Server 2014後PoSh停止工作

安裝的SQL Server 2014 Management Studio中的後,辣妹服務器拒絕啓動與錯誤:

AVERTISSEMENT : Could not detect PoSH Server Module Path.
AVERTISSEMENT : Aborting..

回答

0

這個問題是從這一事實出現以後,服務器2014 Management Studio中的安裝添加新路徑到$env:PSModulePath

C:\Users\BLANCJP\Documents\WindowsPowerShell\Modules 
C:\Program Files\WindowsPowerShell\Modules 
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ 
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\ 

不過,在最初的代碼假設POSH服務器模塊是最後的安裝:

... 
    # Test Module Paths 
    Foreach ($ModulePath in $ModulePaths) 
    { 
    $ModulePath = "$ModulePath\PoSHServer" 
    $ModulePath = $ModulePath.Replace("\\","\") 
    $PoSHModulePathTest = Test-Path $ModulePath 
    if ($PoSHModulePathTest) 
    { 
     $PoSHModulePath = $ModulePath 
    } 
    } 
} 

if (!$PoSHModulePathTest) 
{ 
    Write-Warning "Could not detect PoSH Server Module Path." 
... 

我剛纔添加的暫停指令有我的辣妹再次合作

... 
    # Test Module Paths 
    Foreach ($ModulePath in $ModulePaths) 
    { 
    $ModulePath = "$ModulePath\PoSHServer" 
    $ModulePath = $ModulePath.Replace("\\","\") 
    $PoSHModulePathTest = Test-Path $ModulePath 
    if ($PoSHModulePathTest) 
    { 
     $PoSHModulePath = $ModulePath 
     break 
    } 
    } 
} 

if (!$PoSHModulePathTest) 
{ 
    Write-Warning "Could not detect PoSH Server Module Path." 
... 
相關問題