olegsych / posh-vs Goto Github PK
View Code? Open in Web Editor NEWMakes Visual Studio command line tools available in PowerShell
License: MIT License
Makes Visual Studio command line tools available in PowerShell
License: MIT License
It would be nice if it was possible to forward arguments from Import-VisualStudioEnvironment to vsdevcmd.bat. A typical use case would be to pass -arch=amd64
to it. Thanks!
I am importing the VS2019 x64 environment from my PowerShell profile like this:
Import-BatchEnvironment 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat'
After updating to VS2019 v16.2, the following warning appears on startup:
The input line is too long.
The syntax of the command is incorrect.
Not sure what changed between 16.1 and 16.2 to cause this.
Install-PoshVs
succeeds silently when Visual Studio is not installed.Import-VisualStudioEnvironment
displays a cryptic error message if Visual Studio is not installed.Import-BatchEnvironment : Cannot bind argument to parameter 'batchFile' because it is an empty string.
At C:\Users\olegsych\Documents\WindowsPowerShell\Modules\posh-vs\0.2.1\posh-vs.psm1:62 char:29
+ Import-BatchEnvironment $batchFile
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Import-BatchEnvironment], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Import-BatchEnvironment
My profile is utf-8 but it converted it to UTF-16 LE. It actually made the file unreadable the first time I tried it, but I haven't been able to reproduce that.
An alternative would be to just say something like this during module import: "Hey, go add this to your profile - Import-Module posh-vs; Import-VisualStudioEnvironment
"
I tend to reload my profile with .$profile
on occasion. I started noticing this error:
The input line is too long.
The syntax of the command is incorrect.
$env:path
will show redundant lines added by Import-VisualStudioEnvironment
.
This may or may not be considered a bug, but the workaround is something like this:
if (!(Test-Path env:DevEnvDir)) {Import-VisualStudioEnvironment}
On a system with nothing but Visual Studio 2019 installed, posh-vs adds 1 second (well over 1s on cold start) to powershell startup. It invokes VsDevCmd.bat which in turn spawns a ton of cmd.exe processes just to call reg.exe. This is almost entirely the fault of vsdevcmd, but it would be nice to.. just do something better :| Perhaps pull in the common setup into this module itself (making direct calls to query the registry instead of going through reg.exe), and only call vsdevcmd if explicitly asked to import the more exact user environment.
The readme says:
Makes Visual Studio 2015 command line tools available in PowerShell.
Is there any chance of making this support VS 2017 as well?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.