Code to query Visual Studio installation

There is a C# module for PowerShell to get VS installation path here:

microsoft/vssetup.powershell: PowerShell module to interact with Visual Studio Setup (github.com)

 

My question is, do you know of any similar code that is pure PowerShell not C# for the same or similar purpose?

The tools are outlined here indicating an API that can be queried:

https://docs.microsoft.com/en-us/visualstudio/install/tools-for-managing-visual-studio-instances?view=vs-2019

As far as ‘pure powershell’, what is the issue with this:

Install-Module -Name VSSetup 
Import-Module -Name VSSetup
Get-VSSetupInstance

Hello and sorry for late reply,

Thank you for sharing this link, I didn’t know it exists so added to my bookmarks.

 

There is nothing wrong with VSSetup module, I’m already using it, the reason why I seek PowerShell version of code is to include it into my repository and be able to modify it without introducing new languages.

It looks like I would have to write my function to drill registry, right now I’m not sure if I want this, so I think I’ll just stick with the module.

Thanks again.