views:

333

answers:

2

I'm trying to configure Windows Powershell to work with Visual Studio. Nothing fancy, just get things set so I can cl & nmake. I think all I need to do is edit the path setting(but I don't know how to set that in WPSH).

+1  A: 

You might want to check out this post -- it seems to address your question fairly well (it worked for what I wanted, anyway).

jerhinesmith
+1  A: 

After much digging around, I created a directory in My Documents named WindowsPowerShell, created a file named Microsoft.PowerShell_profile.ps1, and(after a few iterations), inserted the following code in it, and it works.

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

Thanks everyone for their kind help. :-)

Paul Nathan