Use PowerShell for Visual Studio Command Prompt

前端 未结 5 1379
故里飘歌
故里飘歌 2021-01-30 23:33

In a serious intiative to migrate all my command line operations to PowerShell, I would like to avoid using the old fashioned command console for anything. However, the Visual

5条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 00:03

    You can use for example this script to import Visual Studio command prompt environment, see the examples in the script documentation comments, e.g. for Visual Studio 2010:

    Invoke-Environment '"%VS100COMNTOOLS%\vsvars32.bat"' 
    

    Having done that in the beginning of a PowerShell session (from your profile or manually), you get what you ask for in this PowerShell session.

    Or you can use the solution provided by Keith Hill in this answer.

提交回复
热议问题