GithubHelp home page GithubHelp logo

olegsych / posh-vs Goto Github PK

View Code? Open in Web Editor NEW
30.0 3.0 3.0 30 KB

Makes Visual Studio command line tools available in PowerShell

License: MIT License

PowerShell 100.00%
powershell visualstudio

posh-vs's People

Contributors

leon99 avatar olegsych avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

posh-vs's Issues

Allow passing arguments to vsdevcmd.bat

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!

Import-BatchEnvironment: 'The input line is too long'

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.

Cryptic error message when Visual Studio is not installed

  • 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

Install-PoshVs should respect encoding

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"

Import-VisualStudioEnvironment is cumulative

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}

posh-vs adds 1s to powershell startup

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.

image

VS 2017

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.