Windows 7, PowerShell 2, Visual Studio 2015, I'm trying to run the command line C# compiler from PowerShell (not the embedded PowerShell within Visual Studio, but a regular, full-blown command window).
In the normal course of events, before using the command line compilers you need to run C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
but that doesn't work here because the environment variables will be set within cmd.exe and then discarded when control returns to PowerShell.
https://github.com/nightroman/PowerShelf supplies Invoke-Environment.ps1 that sounds like it might be the solution, but Invoke-Environment "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
does nothing, no effect whatsoever.
Am I using Invoke-Environment the wrong way, or is there something else I should be doing?