Install Az module in the packages for a project in Visual Studio

312 views Asked by At

I am trying to install the Az Module to use Az.Accounts commands and few others. I want to install the module for one specific project and be able to see that as a project depedency in the solution explorer in VS 2019 here:

enter image description here

Here I want Az Module as a package. How to do this?

1

There are 1 answers

0
Dylan On BEST ANSWER

You can set the powershell gallery as package source in visual studio, then you can manage it as a package.

The steps:

  1. Go to Tools > Options > NuGet Package Manager > Package Sources
  2. Create a new package source.
  3. Type the source: https://www.powershellgallery.com/api/v2 enter image description here
  4. Right-click the project > Click "Manage Nuget Packages..."
  5. Switch the Package Source to the new source.

enter image description here

  1. Click Refresh button, then install Az Module

enter image description here