iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
💬

How to Get Visual Studio Installation Information with PowerShell

に公開

This article explains how to use PowerShell to retrieve information about Visual Studio installed on your local machine.

We will use the following module provided by Microsoft:

Here is a brief guide on how to use it.

First, install the module.

Install-Module VSSetup -Scope CurrentUser

Then, run the following command to get the installation details.

Get-VSSetupInstance -All

If you also want to include information for preview versions, run the following command:

Get-VSSetupInstance -All -Prerelease

You will then get the results like this:

PS D:\Repos\Zenn> Get-VSSetupInstance -All -Prerelease

InstanceId          : 7495014a
DisplayName         : Visual Studio Enterprise 2022
InstallationVersion : 17.0.31512.422
InstallationPath    : D:\Program Files\Microsoft Visual Studio\2022\Preview
InstallDate         : 2021/07/22 9:03:13

InstanceId          : 951807ba
DisplayName         : Visual Studio Enterprise 2019
InstallationVersion : 16.11.31702.278
InstallationPath    : C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
InstallDate         : 2021/03/26 9:38:29

The rest is up to you to use as you like in PowerShell. That's all!

Discussion