Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/microsoft/vssetup.powershell
PowerShell module to interact with Visual Studio Setup
https://github.com/microsoft/vssetup.powershell
powershell visual-studio
Last synced: 30 days ago
JSON representation
PowerShell module to interact with Visual Studio Setup
- Host: GitHub
- URL: https://github.com/microsoft/vssetup.powershell
- Owner: microsoft
- License: mit
- Created: 2017-01-14T06:01:56.000Z (almost 8 years ago)
- Default Branch: develop
- Last Pushed: 2024-08-21T03:13:18.000Z (3 months ago)
- Last Synced: 2024-10-01T04:41:35.823Z (about 1 month ago)
- Topics: powershell, visual-studio
- Language: C#
- Size: 256 KB
- Stars: 228
- Watchers: 21
- Forks: 40
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Visual Studio Setup PowerShell Module
=====================================![build status: master](https://devdiv.visualstudio.com/DevDiv/_apis/build/status/Setup/Setup-VSSetup.PowerShell-CI?branchName=master&label=master)
![build status: develop](https://devdiv.visualstudio.com/DevDiv/_apis/build/status/Setup/Setup-VSSetup.PowerShell-CI?branchName=develop&label=develop)
[![github release](https://img.shields.io/github/release/Microsoft/VSSetup.PowerShell.svg?logo=github&logoColor=white)](https://github.com/Microsoft/VSSetup.PowerShell/releases/latest)
[![github releases: all](https://img.shields.io/github/downloads/Microsoft/VSSetup.PowerShell/total.svg?logo=github&logoColor=white&label=github)](https://github.com/Microsoft/VSSetup.PowerShell/releases)
[![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/VSSetup.svg?logo=powershell&logoColor=white&label=gallery)](https://powershellgallery.com/packages/VSSetup)This PowerShell module contains cmdlets to query instances of Visual Studio 2017 and newer. It also serves as a more useful sample of using the Setup Configuration APIs than the previously [published samples][samples] though those also have samples using VB and VC++.
## Installing
With Windows Management Framework 5.0 or newer (which installs PowerShell and comes with Windows 10), or [PowerShellGet][psget] for PowerShell 3.0 or 4.0, you can download and install this module easily.
```powershell
Install-Module VSSetup -Scope CurrentUser
```To install for all users, pass `AllUsers` instead of `CurrentUser`, or just leave the `-Scope` parameter out of the command entirely.
You can also download the ZIP package from the [Releases][releases] page on this project site and extract to a directory named _VSSetup_ under a directory in your `$env:PSMODULEPATH`.
```powershell
Expand-Archive VSSetup.zip "$([Environment]::GetFolderPath("MyDocuments"))\WindowsPowerShell\Modules\VSSetup"
```## Using
You can query all usable instances of Visual Studio and other products installed by the Visual Studio installer.
```powershell
Get-VSSetupInstance
```To get the instance for a specific installation directory, you can run the following.
```powershell
Get-VSSetupInstance 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community'
```If you want to select the latest instance that contains the .NET desktop development workload, you can pipe all instances - usable or not - to `Select-VSSetupInstance` that provides more fine grain control over which instances you enumerate.
```powershell
Get-VSSetupInstance -All | Select-VSSetupInstance -Require 'Microsoft.VisualStudio.Workload.ManagedDesktop' -Latest
```## Feedback
To file issues or suggestions, please use the [Issues][issues] page for this project on GitHub.
## License
This project is licensed under the [MIT license](LICENSE.txt).
## Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
[issues]: https://github.com/Microsoft/vssetup.powershell/issues
[psget]: http://go.microsoft.com/fwlink/?LinkID=746217
[releases]: https://github.com/Microsoft/vssetup.powershell/releases
[samples]: https://aka.ms/setup/configuration/samples