You can import the environment variables from Visual Studio's batch script using the Invoke-CmdScript
function from this article:
Take Charge of Environment Variables in PowerShell
The function's definition is as follows:
# Invokes a Cmd.exe shell script and updates the environment.
function Invoke-CmdScript {
param(
[String] $scriptName
)
$cmdLine = """$scriptName"" $args & set"
& $Env:SystemRoot\system32\cmd.exe /c $cmdLine |
Select-String '^([^=]*)=(.*)$' | ForEach-Object {
$varName = $_.Matches[0].Groups[1].Value
$varValue = $_.Matches[0].Groups[2].Value
Set-Item Env:$varName $varValue
}
}
Put this function in your PowerShell profile and you can use it to run the Visual Studio script that sets the needed environment variables.
The article also contains Get-Environment
and Restore-Environment
functions if you want to implement scope for the environment variables the Visual Studio script sets.
mt.exe
if it is not recognised by PowerShell..\mt -manifest patch.exe.manifest -outputresource:patch.exe;1