2008-10-13 83 views
2

我正在嘗試配置Windows Powershell以使用Visual Studio。沒有什麼奇特的,只是讓事情設置,所以我可以cl & nmake。我認爲我需要做的就是編輯路徑設置(但我不知道如何設置WPSH)。Windows Powershell和Visual Studio '08路徑

回答

2

很多周圍挖掘後,我創建了我的文檔目錄名爲WindowsPowerShell,創建了一個名爲Microsoft.PowerShell_profile.ps1文件,(經過幾次迭代),插在它下面的代碼,它作品。

function Get-Batchfile($file) 
{ 
    $theCmd = "`"$file`" & set" 
    cmd /c $theCmd | Foreach-Object { 
     $thePath, $theValue = $_.split('=') 
     Set-Item -path env:$thePath -value $theValue 
    } 
} 


Get-Batchfile("C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat") 

感謝大家的幫助。 :-)

1

您可能想查看this post - 它似乎很好地解決了您的問題(無論如何,它都適用於我想要的)。