Skip to content

A Powershell function that you can use to interactively choose your preferred context based on accounts you previously connected through Connect-AzAccount

Notifications You must be signed in to change notification settings

stefanpetter/PS-InteractiveAzContext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

InteractiveAzContext

A Powershell function that you can use to interactively choose your preferred context based on accounts you previously connected through Connect-AzAccount

How to use it

Paste the function in your Powershell profile. By running $profile within powershell you can determine the location of your PowerShell Profile. Prefixing the variable with your favorite editor will open the profile directly. For example:

code $profile

After opening a new shell, the function 'azc' will be available. Please note that this will impact the loading time of your PowerShell setup.

How does it work?

  • It will list all your connected Contexts through Get-AzContext -List
  • You choose an account (No input defaults to 0)
  • It will list all the Enabled subscriptions accessible through the selected account
  • You choose a subscription (No input defaults to 0)
  • The context will be set

About

A Powershell function that you can use to interactively choose your preferred context based on accounts you previously connected through Connect-AzAccount

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •