{"id":22,"date":"2018-07-03T10:16:00","date_gmt":"2018-07-03T15:16:00","guid":{"rendered":""},"modified":"2023-07-26T12:52:49","modified_gmt":"2023-07-26T17:52:49","slug":"run-visual-studio-command-tools-within-powershell","status":"publish","type":"post","link":"https:\/\/www.chrystalsander.com\/blog\/?p=22","title":{"rendered":"Run Visual Studio Command Tools Within Powershell"},"content":{"rendered":"<p>Visual Studio command tools (ie, msbuild, mstest, dotnet) can be directly executed from Powershell and open in a new window.<\/p>\n<div>\n<\/div>\n<div>\nLikewise, the reverse can also occur.&nbsp; You can run Powershell from within the Visual Studio tools.<\/div>\n<div>\n<\/div>\n<div>\n<ol>\n<li>Depending on your version of Visual Studio, locate the path to the common tools.&nbsp; For example, if you decided to set an environment variable for this path, it could be something like:<\/li>\n<ol>\n<li>VS150COMNTOOLS=C:Program Files (x86)Microsoft Visual Studio2017CommunityCommon7Tools<\/li>\n<li>VS140COMNTOOLS=C:Program Files (x86)Microsoft Visual Studio 14.0Common7Tools<\/li>\n<li>VS120COMNTOOLS=C:Program Files (x86)Microsoft Visual Studio 12.0Common7Tools<\/li>\n<li>VS110COMNTOOLS=C:Program Files (x86)Microsoft Visual Studio 11.0Common7Tools<\/li>\n<\/ol>\n<li>At this point,&nbsp; you can open the tool by opening Run &#8211;&gt;&nbsp;cmd.exe \/k &#8220;&#8221;%VS150COMNTOOLS%VsDevCmd.bat&#8221; &amp; powershell&#8221;<\/li>\n<li>At this point, a Powershell prompt will open so that you can directly run msbuild, mstest, etc.<\/li>\n<\/ol>\n<\/div>\n<div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Visual Studio command tools (ie, msbuild, mstest, dotnet) can be directly executed from Powershell and open in a new window. Likewise, the reverse can also occur.&nbsp; You can run Powershell from within the Visual Studio tools. Depending on your version of Visual Studio, locate the path to the common tools.&nbsp; For example, if you decided &hellip; <a href=\"https:\/\/www.chrystalsander.com\/blog\/?p=22\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Run Visual Studio Command Tools Within Powershell&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,12],"tags":[44,74],"_links":{"self":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/22"}],"collection":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22"}],"version-history":[{"count":1,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":155,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions\/155"}],"wp:attachment":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}