Get Visual Studio 2014 Path

  • Hi,

    If I run the below path I get the path as : "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\"....but I need the below path :

    'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE' as an output as the tf.exe is located to the above path.

    I tried to change the below string as below, but no luck -

    $vsEnvVars = (dir Env:).Name -match "VS[0-9]{1,3}COMNIDE"

    clear

    $vsEnvVars = (dir Env:).Name -match "VS[0-9]{1,3}COMNTOOL"

    $latestVs = $vsEnvVars | Sort-Object | Select -Last 1

    $latestVs

    $vsPath = Get-Content Env:\$latestVs

    $vsPath

    Thanks.

  • Have you tried the following?

    $vsEnvVars = (dir Env:).Name -match "VS[0-9]{1,3}COMNTOOL"

    $vsEnvVars = $vsEnvVars + "..\IDE\"

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply