mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 04:19:41 -08:00
parent
744764a05e
commit
f4fa7a4166
|
@ -42,14 +42,15 @@ Display the currently active Azure subscription information.
|
|||
|
||||
### Properties
|
||||
|
||||
- `.EnvironmentName`: `string` - the account environment name
|
||||
- `.HomeTenantID`: `string` - the home tenant id
|
||||
- `.ID`: `string` - the account/subscription id
|
||||
- `.EnvironmentName`: `string` - account environment name
|
||||
- `.HomeTenantID`: `string` - home tenant id
|
||||
- `.ID`: `string` - account/subscription id
|
||||
- `.IsDefault`: `boolean` - is the default account or not
|
||||
- `.Name`: `string` - the account name
|
||||
- `.State`: `string` - the account state
|
||||
- `.TenantID`: `string` - the tenant id
|
||||
- `.User.Name`: `string` - the user name
|
||||
- `.Name`: `string` - account name
|
||||
- `.State`: `string` - account state
|
||||
- `.TenantID`: `string` - tenant id
|
||||
- `.User.Name`: `string` - user name
|
||||
- `.User.Type`: `string` - user type
|
||||
- `.Origin`: `string` - where we received the information from, can be `CLI` or `PWSH`
|
||||
|
||||
[templates]: /docs/config-templates
|
||||
|
|
|
@ -43,6 +43,7 @@ type AzureSubscription struct {
|
|||
|
||||
type AzureUser struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
type AzurePowerShellConfig struct {
|
||||
|
@ -166,6 +167,7 @@ func (a *Az) getModuleSubscription() bool {
|
|||
a.State = defaultContext.Subscription.State
|
||||
a.User = &AzureUser{
|
||||
Name: defaultContext.Subscription.ExtendedProperties.Account,
|
||||
Type: defaultContext.Account.Type,
|
||||
}
|
||||
a.Origin = "PWSH"
|
||||
return true
|
||||
|
|
|
@ -97,6 +97,14 @@ func TestAzSegment(t *testing.T) {
|
|||
Template: "{{ .EnvironmentName }}",
|
||||
Source: pwsh,
|
||||
},
|
||||
{
|
||||
Case: "Az CLI account type",
|
||||
ExpectedEnabled: true,
|
||||
ExpectedString: "user",
|
||||
Template: "{{ .User.Type }}",
|
||||
HasCLI: true,
|
||||
Source: cli,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"My Azure Subscription (subscription_id) - tenant_id - user_name": {
|
||||
"Account": {
|
||||
"Id": "232-232-232-232",
|
||||
"Type": "User",
|
||||
"Type": "user",
|
||||
"TenantMap": {},
|
||||
"ExtendedProperties": {
|
||||
"Subscriptions": "subscription_ids",
|
||||
|
|
Loading…
Reference in a new issue