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).
Asked
Active
Viewed 823 times
2 Answers
2
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
- 39,638
- 28
- 112
- 212
1
You might want to check out this post -- it seems to address your question fairly well (it worked for what I wanted, anyway).

Community
- 1
- 1

jerhinesmith
- 15,214
- 17
- 62
- 89