Hi,
Welcome to MSDN forum.
Please have a look at
Tools for detecting and managing Visual Studio instances. You can also use
VSSetup.PowerShell: PowerShell scripts that use the Setup Configuration API to identify installed instances of Visual Studio.

Best regards,
Joyce
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints
to MSDN Support, feel free to contact MSDNFSF@microsoft.com.