mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
feat(az): parse pwsh context from module output
this fixes an issue where using multiple powershell sessions with a different Azure context would display the same context everywhere when using Set-AzContext to switch between them BREAKING CHANGE: this requires adding `$env:POSH_AZURE_ENABLED = $true` to your PowerShell profile if you want to get the correct context displayed in your prompt for Azure powershell
This commit is contained in:
parent
a16f18f9ec
commit
56ae9e6fda
|
@ -23,6 +23,7 @@ const (
|
||||||
pwsh = "pwsh"
|
pwsh = "pwsh"
|
||||||
cli = "cli"
|
cli = "cli"
|
||||||
firstMatch = "first_match"
|
firstMatch = "first_match"
|
||||||
|
azureEnv = "POSH_AZURE_SUBSCRIPTION"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AzureConfig struct {
|
type AzureConfig struct {
|
||||||
|
@ -47,47 +48,25 @@ type AzureUser struct {
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AzurePowerShellConfig struct {
|
|
||||||
DefaultContextKey string `json:"DefaultContextKey"`
|
|
||||||
Contexts map[string]*AzurePowerShellSubscription `json:"Contexts"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type AzurePowerShellSubscription struct {
|
type AzurePowerShellSubscription struct {
|
||||||
|
Name string `json:"Name"`
|
||||||
Account struct {
|
Account struct {
|
||||||
ID string `json:"Id"`
|
Type string `json:"Type"`
|
||||||
Credential interface{} `json:"Credential"`
|
|
||||||
Type string `json:"Type"`
|
|
||||||
TenantMap struct {
|
|
||||||
} `json:"TenantMap"`
|
|
||||||
ExtendedProperties struct {
|
|
||||||
Subscriptions string `json:"Subscriptions"`
|
|
||||||
Tenants string `json:"Tenants"`
|
|
||||||
HomeAccountID string `json:"HomeAccountId"`
|
|
||||||
} `json:"ExtendedProperties"`
|
|
||||||
} `json:"Account"`
|
} `json:"Account"`
|
||||||
Tenant struct {
|
Environment struct {
|
||||||
ID string `json:"Id"`
|
Name string `json:"Name"`
|
||||||
Directory interface{} `json:"Directory"`
|
} `json:"Environment"`
|
||||||
IsHome bool `json:"IsHome"`
|
|
||||||
ExtendedProperties struct {
|
|
||||||
} `json:"ExtendedProperties"`
|
|
||||||
} `json:"Tenant"`
|
|
||||||
Subscription struct {
|
Subscription struct {
|
||||||
ID string `json:"Id"`
|
ID string `json:"Id"`
|
||||||
Name string `json:"Name"`
|
Name string `json:"Name"`
|
||||||
State string `json:"State"`
|
State string `json:"State"`
|
||||||
ExtendedProperties struct {
|
ExtendedProperties struct {
|
||||||
HomeTenant string `json:"HomeTenant"`
|
Account string `json:"Account"`
|
||||||
AuthorizationSource string `json:"AuthorizationSource"`
|
|
||||||
SubscriptionPolices string `json:"SubscriptionPolices"`
|
|
||||||
Tenants string `json:"Tenants"`
|
|
||||||
Account string `json:"Account"`
|
|
||||||
Environment string `json:"Environment"`
|
|
||||||
} `json:"ExtendedProperties"`
|
} `json:"ExtendedProperties"`
|
||||||
} `json:"Subscription"`
|
} `json:"Subscription"`
|
||||||
Environment struct {
|
Tenant struct {
|
||||||
Name string `json:"Name"`
|
ID string `json:"Id"`
|
||||||
} `json:"Environment"`
|
} `json:"Tenant"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Az) Template() string {
|
func (a *Az) Template() string {
|
||||||
|
@ -142,31 +121,23 @@ func (a *Az) getCLISubscription() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Az) getModuleSubscription() bool {
|
func (a *Az) getModuleSubscription() bool {
|
||||||
cfg, err := a.findConfig("AzureRmContext.json")
|
envSubscription := a.env.Getenv(azureEnv)
|
||||||
if err != nil {
|
if len(envSubscription) == 0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
content := a.FileContentWithoutBom(cfg)
|
var config AzurePowerShellSubscription
|
||||||
if len(content) == 0 {
|
if err := json.Unmarshal([]byte(envSubscription), &config); err != nil {
|
||||||
return false
|
|
||||||
}
|
|
||||||
var config AzurePowerShellConfig
|
|
||||||
if err := json.Unmarshal([]byte(content), &config); err != nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
defaultContext := config.Contexts[config.DefaultContextKey]
|
|
||||||
if defaultContext == nil {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
a.IsDefault = true
|
a.IsDefault = true
|
||||||
a.EnvironmentName = defaultContext.Environment.Name
|
a.EnvironmentName = config.Environment.Name
|
||||||
a.TenantID = defaultContext.Tenant.ID
|
a.TenantID = config.Tenant.ID
|
||||||
a.ID = defaultContext.Subscription.ID
|
a.ID = config.Subscription.ID
|
||||||
a.Name = defaultContext.Subscription.Name
|
a.Name = config.Subscription.Name
|
||||||
a.State = defaultContext.Subscription.State
|
a.State = config.Subscription.State
|
||||||
a.User = &AzureUser{
|
a.User = &AzureUser{
|
||||||
Name: defaultContext.Subscription.ExtendedProperties.Account,
|
Name: config.Subscription.ExtendedProperties.Account,
|
||||||
Type: defaultContext.Account.Type,
|
Type: config.Account.Type,
|
||||||
}
|
}
|
||||||
a.Origin = "PWSH"
|
a.Origin = "PWSH"
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -124,21 +124,14 @@ func TestAzSegment(t *testing.T) {
|
||||||
|
|
||||||
env.On("GOOS").Return(environment.LINUX)
|
env.On("GOOS").Return(environment.LINUX)
|
||||||
env.On("FileContent", filepath.Join(home, ".azure", "azureProfile.json")).Return(azureProfile)
|
env.On("FileContent", filepath.Join(home, ".azure", "azureProfile.json")).Return(azureProfile)
|
||||||
env.On("FileContent", filepath.Join(home, ".azure", "AzureRmContext.json")).Return(azureRmContext)
|
env.On("Getenv", "POSH_AZURE_SUBSCRIPTION").Return(azureRmContext)
|
||||||
env.On("Getenv", "AZURE_CONFIG_DIR").Return("")
|
env.On("Getenv", "AZURE_CONFIG_DIR").Return("")
|
||||||
|
|
||||||
if tc.HasCLI {
|
if tc.HasCLI {
|
||||||
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.azure"), "azureProfile.json").Return(true)
|
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.azure"), "azureProfile.json").Return(true)
|
||||||
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.azure"), "AzureRmContext.json").Return(false)
|
|
||||||
} else if tc.HasPowerShell {
|
|
||||||
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.azure"), "azureProfile.json").Return(false)
|
|
||||||
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.Azure"), "azureProfile.json").Return(false)
|
|
||||||
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.azure"), "AzureRmContext.json").Return(true)
|
|
||||||
} else {
|
} else {
|
||||||
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.azure"), "azureProfile.json").Return(false)
|
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.azure"), "azureProfile.json").Return(false)
|
||||||
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.Azure"), "azureProfile.json").Return(false)
|
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.Azure"), "azureProfile.json").Return(false)
|
||||||
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.azure"), "AzureRmContext.json").Return(false)
|
|
||||||
env.On("HasFilesInDir", filepath.Clean("/Users/posh/.Azure"), "AzureRmContext.json").Return(false)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if tc.Source == "" {
|
if tc.Source == "" {
|
||||||
|
|
|
@ -25,10 +25,25 @@ New-Module -Name "oh-my-posh-core" -ScriptBlock {
|
||||||
if ((::CONFIG:: -ne '') -and (Test-Path ::CONFIG::)) {
|
if ((::CONFIG:: -ne '') -and (Test-Path ::CONFIG::)) {
|
||||||
$env:POSH_THEME = (Resolve-Path -Path ::CONFIG::).ProviderPath
|
$env:POSH_THEME = (Resolve-Path -Path ::CONFIG::).ProviderPath
|
||||||
}
|
}
|
||||||
|
|
||||||
# specific module support (disabled by default)
|
# specific module support (disabled by default)
|
||||||
if (($null -eq $env:POSH_GIT_ENABLED) -or ($null -eq (Get-Module 'posh-git'))) {
|
if (($null -eq $env:POSH_GIT_ENABLED) -or ($null -eq (Get-Module 'posh-git'))) {
|
||||||
$env:POSH_GIT_ENABLED = $false
|
$env:POSH_GIT_ENABLED = $false
|
||||||
}
|
}
|
||||||
|
if (($null -eq $env:POSH_AZURE_ENABLED) -or ($null -eq (Get-Module 'az'))) {
|
||||||
|
$env:POSH_AZURE_ENABLED = $false
|
||||||
|
}
|
||||||
|
|
||||||
|
function Initialize-ModuleSupport {
|
||||||
|
if ($env:POSH_GIT_ENABLED -eq $true) {
|
||||||
|
# We need to set the status so posh-git can facilitate autocomplete
|
||||||
|
$global:GitStatus = Get-GitStatus
|
||||||
|
$env:POSH_GIT_STATUS = $global:GitStatus | ConvertTo-Json
|
||||||
|
}
|
||||||
|
if ($env:POSH_AZURE_ENABLED -eq $true) {
|
||||||
|
$env:POSH_AZURE_SUBSCRIPTION = Get-AzContext | ConvertTo-Json
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function Start-Utf8Process {
|
function Start-Utf8Process {
|
||||||
param(
|
param(
|
||||||
|
@ -93,14 +108,6 @@ New-Module -Name "oh-my-posh-core" -ScriptBlock {
|
||||||
return $cleanPWD, $cleanPSWD
|
return $cleanPWD, $cleanPSWD
|
||||||
}
|
}
|
||||||
|
|
||||||
function Initialize-ModuleSupport {
|
|
||||||
if ($env:POSH_GIT_ENABLED -eq $true) {
|
|
||||||
# We need to set the status so posh-git can facilitate autocomplete
|
|
||||||
$global:GitStatus = Get-GitStatus
|
|
||||||
$env:POSH_GIT_STATUS = $global:GitStatus | ConvertTo-Json
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (("::TOOLTIPS::" -eq "true") -and ($ExecutionContext.SessionState.LanguageMode -ne "ConstrainedLanguage")) {
|
if (("::TOOLTIPS::" -eq "true") -and ($ExecutionContext.SessionState.LanguageMode -ne "ConstrainedLanguage")) {
|
||||||
Set-PSReadLineKeyHandler -Key Spacebar -BriefDescription 'OhMyPoshSpaceKeyHandler' -ScriptBlock {
|
Set-PSReadLineKeyHandler -Key Spacebar -BriefDescription 'OhMyPoshSpaceKeyHandler' -ScriptBlock {
|
||||||
[Microsoft.PowerShell.PSConsoleReadLine]::Insert(' ')
|
[Microsoft.PowerShell.PSConsoleReadLine]::Insert(' ')
|
||||||
|
|
|
@ -1,81 +1,112 @@
|
||||||
{
|
{
|
||||||
"DefaultContextKey": "My Azure Subscription (subscription_id) - tenant_id - user_name",
|
"Name": "MVP (c2733c30-f2c9-45bd-9f1f-528d7c6191b8) - be96dc2e-13ce-4ee1-9cad-13b52b893716 - jan@ohmyposh.dev",
|
||||||
"EnvironmentTable": {},
|
"Account": {
|
||||||
"Contexts": {
|
"Id": "jan@ohmyposh.dev",
|
||||||
"My Azure Subscription (subscription_id) - tenant_id - user_name": {
|
"Type": "User",
|
||||||
"Account": {
|
"Tenants": [
|
||||||
"Id": "232-232-232-232",
|
"be96dc2e-13ce-4ee1-9cad-13b52b893716"
|
||||||
"Type": "user",
|
],
|
||||||
"TenantMap": {},
|
"AccessToken": null,
|
||||||
"ExtendedProperties": {
|
"Credential": null,
|
||||||
"Subscriptions": "subscription_ids",
|
"TenantMap": {},
|
||||||
"Tenants": "tenants_ids",
|
"CertificateThumbprint": null,
|
||||||
"HomeAccountId": "tenants_ids"
|
"ExtendedProperties": {
|
||||||
}
|
"Tenants": "be96dc2e-13ce-4ee1-9cad-13b52b893716",
|
||||||
},
|
"HomeAccountId": "360a9158-bf5d-45a7-8539-88e7f6f1d90b.161de531-8316-49b4-88fb-1a669ecc3b5c",
|
||||||
"Tenant": {
|
"Subscriptions": "c2733c30-f2c9-45bd-9f1f-528d7c6191b8"
|
||||||
"Id": "4777-4777-4777-4777",
|
|
||||||
"Directory": null,
|
|
||||||
"IsHome": true,
|
|
||||||
"ExtendedProperties": {}
|
|
||||||
},
|
|
||||||
"Subscription": {
|
|
||||||
"Id": "97hkk-97hkk-97hkk-97hkk",
|
|
||||||
"Name": "AzurePosh",
|
|
||||||
"State": "Poshfull",
|
|
||||||
"ExtendedProperties": {
|
|
||||||
"HomeTenant": "688ab8f8-d8d8-4c8b-b8b8-b8b8b8b8b8b8",
|
|
||||||
"AuthorizationSource": "Legacy",
|
|
||||||
"SubscriptionPolices": "{\"locationPlacementId\":\"Public_2014-09-01\",\"quotaId\":\"MSDN_2014-09-01\",\"spendingLimit\":\"On\"}",
|
|
||||||
"Tenants": "4777-4777-4777-4777",
|
|
||||||
"Account": "Bill",
|
|
||||||
"Environment": "AzurePoshCloud"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Environment": {
|
|
||||||
"Name": "AzurePoshCloud",
|
|
||||||
"Type": "Built-in",
|
|
||||||
"OnPremise": false,
|
|
||||||
"ServiceManagementUrl": "https://management.core.windows.net/",
|
|
||||||
"ResourceManagerUrl": "https://management.azure.com/",
|
|
||||||
"ManagementPortalUrl": "https://portal.azure.com/",
|
|
||||||
"PublishSettingsFileUrl": "https://go.microsoft.com/fwlink/?LinkID=301775",
|
|
||||||
"ActiveDirectoryAuthority": "https://login.microsoftonline.com/",
|
|
||||||
"GalleryUrl": "https://gallery.azure.com/",
|
|
||||||
"GraphUrl": "https://graph.windows.net/",
|
|
||||||
"ActiveDirectoryServiceEndpointResourceId": "https://management.core.windows.net/",
|
|
||||||
"StorageEndpointSuffix": "core.windows.net",
|
|
||||||
"SqlDatabaseDnsSuffix": ".database.windows.net",
|
|
||||||
"TrafficManagerDnsSuffix": "trafficmanager.net",
|
|
||||||
"AzureKeyVaultDnsSuffix": "vault.azure.net",
|
|
||||||
"AzureKeyVaultServiceEndpointResourceId": "https://vault.azure.net",
|
|
||||||
"GraphEndpointResourceId": "https://graph.windows.net/",
|
|
||||||
"DataLakeEndpointResourceId": "https://datalake.azure.net/",
|
|
||||||
"BatchEndpointResourceId": "https://batch.core.windows.net/",
|
|
||||||
"AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix": "azuredatalakeanalytics.net",
|
|
||||||
"AzureDataLakeStoreFileSystemEndpointSuffix": "azuredatalakestore.net",
|
|
||||||
"AdTenant": "Common",
|
|
||||||
"ContainerRegistryEndpointSuffix": "azurecr.io",
|
|
||||||
"VersionProfiles": [],
|
|
||||||
"ExtendedProperties": {
|
|
||||||
"OperationalInsightsEndpoint": "https://api.loganalytics.io/v1",
|
|
||||||
"OperationalInsightsEndpointResourceId": "https://api.loganalytics.io",
|
|
||||||
"AzureAnalysisServicesEndpointSuffix": "asazure.windows.net",
|
|
||||||
"AnalysisServicesEndpointResourceId": "https://region.asazure.windows.net",
|
|
||||||
"AzureAttestationServiceEndpointSuffix": "attest.azure.net",
|
|
||||||
"AzureAttestationServiceEndpointResourceId": "https://attest.azure.net",
|
|
||||||
"AzureSynapseAnalyticsEndpointSuffix": "dev.azuresynapse.net",
|
|
||||||
"AzureSynapseAnalyticsEndpointResourceId": "https://dev.azuresynapse.net",
|
|
||||||
"ManagedHsmServiceEndpointResourceId": "https://managedhsm.azure.net",
|
|
||||||
"ManagedHsmServiceEndpointSuffix": "managedhsm.azure.net",
|
|
||||||
"MicrosoftGraphEndpointResourceId": "https://graph.microsoft.com/",
|
|
||||||
"MicrosoftGraphUrl": "https://graph.microsoft.com"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"VersionProfile": null,
|
|
||||||
"TokenCache": { "CacheData": null },
|
|
||||||
"ExtendedProperties": {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Environment": {
|
||||||
|
"Name": "AzurePoshCloud",
|
||||||
|
"Type": "Built-in",
|
||||||
|
"EnableAdfsAuthentication": false,
|
||||||
|
"OnPremise": false,
|
||||||
|
"ActiveDirectoryServiceEndpointResourceId": "https://management.core.windows.net/",
|
||||||
|
"AdTenant": "Common",
|
||||||
|
"GalleryUrl": "https://gallery.azure.com/",
|
||||||
|
"ManagementPortalUrl": "https://portal.azure.com/",
|
||||||
|
"ServiceManagementUrl": "https://management.core.windows.net/",
|
||||||
|
"PublishSettingsFileUrl": "https://go.microsoft.com/fwlink/?LinkID=301775",
|
||||||
|
"ResourceManagerUrl": "https://management.azure.com/",
|
||||||
|
"SqlDatabaseDnsSuffix": ".database.windows.net",
|
||||||
|
"StorageEndpointSuffix": "core.windows.net",
|
||||||
|
"ActiveDirectoryAuthority": "https://login.microsoftonline.com/",
|
||||||
|
"GraphUrl": "https://graph.windows.net/",
|
||||||
|
"GraphEndpointResourceId": "https://graph.windows.net/",
|
||||||
|
"TrafficManagerDnsSuffix": "trafficmanager.net",
|
||||||
|
"AzureKeyVaultDnsSuffix": "vault.azure.net",
|
||||||
|
"DataLakeEndpointResourceId": "https://datalake.azure.net/",
|
||||||
|
"AzureDataLakeStoreFileSystemEndpointSuffix": "azuredatalakestore.net",
|
||||||
|
"AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix": "azuredatalakeanalytics.net",
|
||||||
|
"AzureKeyVaultServiceEndpointResourceId": "https://vault.azure.net",
|
||||||
|
"ContainerRegistryEndpointSuffix": "azurecr.io",
|
||||||
|
"AzureOperationalInsightsEndpointResourceId": "https://api.loganalytics.io",
|
||||||
|
"AzureOperationalInsightsEndpoint": "https://api.loganalytics.io/v1",
|
||||||
|
"AzureAnalysisServicesEndpointSuffix": "asazure.windows.net",
|
||||||
|
"AnalysisServicesEndpointResourceId": "https://region.asazure.windows.net",
|
||||||
|
"AzureAttestationServiceEndpointSuffix": "attest.azure.net",
|
||||||
|
"AzureAttestationServiceEndpointResourceId": "https://attest.azure.net",
|
||||||
|
"AzureSynapseAnalyticsEndpointSuffix": "dev.azuresynapse.net",
|
||||||
|
"AzureSynapseAnalyticsEndpointResourceId": "https://dev.azuresynapse.net",
|
||||||
|
"VersionProfiles": [],
|
||||||
|
"ExtendedProperties": {
|
||||||
|
"OperationalInsightsEndpoint": "https://api.loganalytics.io/v1",
|
||||||
|
"OperationalInsightsEndpointResourceId": "https://api.loganalytics.io",
|
||||||
|
"AzureAnalysisServicesEndpointSuffix": "asazure.windows.net",
|
||||||
|
"AnalysisServicesEndpointResourceId": "https://region.asazure.windows.net",
|
||||||
|
"AzureAttestationServiceEndpointSuffix": "attest.azure.net",
|
||||||
|
"AzureAttestationServiceEndpointResourceId": "https://attest.azure.net",
|
||||||
|
"AzureSynapseAnalyticsEndpointSuffix": "dev.azuresynapse.net",
|
||||||
|
"AzureSynapseAnalyticsEndpointResourceId": "https://dev.azuresynapse.net",
|
||||||
|
"ManagedHsmServiceEndpointResourceId": "https://managedhsm.azure.net",
|
||||||
|
"ManagedHsmServiceEndpointSuffix": "managedhsm.azure.net",
|
||||||
|
"MicrosoftGraphEndpointResourceId": "https://graph.microsoft.com/",
|
||||||
|
"MicrosoftGraphUrl": "https://graph.microsoft.com",
|
||||||
|
"AzurePurviewEndpointSuffix": "purview.azure.net",
|
||||||
|
"AzurePurviewEndpointResourceId": "https://purview.azure.net"
|
||||||
|
},
|
||||||
|
"BatchEndpointResourceId": "https://batch.core.windows.net/"
|
||||||
|
},
|
||||||
|
"Subscription": {
|
||||||
|
"Id": "c2733c30-f2c9-45bd-9f1f-528d7c6191b8",
|
||||||
|
"Name": "MVP",
|
||||||
|
"State": "Enabled",
|
||||||
|
"SubscriptionId": "c2733c30-f2c9-45bd-9f1f-528d7c6191b8",
|
||||||
|
"TenantId": "be96dc2e-13ce-4ee1-9cad-13b52b893716",
|
||||||
|
"HomeTenantId": "be96dc2e-13ce-4ee1-9cad-13b52b893716",
|
||||||
|
"ManagedByTenantIds": [],
|
||||||
|
"CurrentStorageAccountName": null,
|
||||||
|
"SubscriptionPolicies": {
|
||||||
|
"LocationPlacementId": "Public_2014-09-01",
|
||||||
|
"QuotaId": "MSDN_2014-09-01",
|
||||||
|
"SpendingLimit": "On"
|
||||||
|
},
|
||||||
|
"ExtendedProperties": {
|
||||||
|
"Account": "jan.de.dobbeleer@gmail.com",
|
||||||
|
"Tenants": "be96dc2e-13ce-4ee1-9cad-13b52b893716",
|
||||||
|
"AuthorizationSource": "Legacy",
|
||||||
|
"SubscriptionPolices": "{\"locationPlacementId\":\"Public_2014-09-01\",\"quotaId\":\"MSDN_2014-09-01\",\"spendingLimit\":\"On\"}",
|
||||||
|
"HomeTenant": "be96dc2e-13ce-4ee1-9cad-13b52b893716",
|
||||||
|
"Environment": "AzureCloud"
|
||||||
|
},
|
||||||
|
"CurrentStorageAccount": null,
|
||||||
|
"AuthorizationSource": "Legacy",
|
||||||
|
"Tags": null
|
||||||
|
},
|
||||||
|
"Tenant": {
|
||||||
|
"Id": "be96dc2e-13ce-4ee1-9cad-13b52b893716",
|
||||||
|
"TenantId": "be96dc2e-13ce-4ee1-9cad-13b52b893716",
|
||||||
|
"ExtendedProperties": {},
|
||||||
|
"TenantCategory": null,
|
||||||
|
"Country": null,
|
||||||
|
"CountryCode": null,
|
||||||
|
"Name": null,
|
||||||
|
"Domains": [],
|
||||||
|
"DefaultDomain": null,
|
||||||
|
"TenantType": null,
|
||||||
|
"TenantBrandingLogoUrl": null
|
||||||
|
},
|
||||||
|
"TokenCache": null,
|
||||||
|
"VersionProfile": null,
|
||||||
"ExtendedProperties": {}
|
"ExtendedProperties": {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,12 @@ sidebar_label: Azure
|
||||||
|
|
||||||
Display the currently active Azure subscription information.
|
Display the currently active Azure subscription information.
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
PowerShell offers support for the [az][az] module, but it is disabled by default.
|
||||||
|
To enable this, set `$env:POSH_AZURE_ENABLED = $true` in your `$PROFILE` after
|
||||||
|
initializing Oh My Posh.
|
||||||
|
:::
|
||||||
|
|
||||||
## Sample Configuration
|
## Sample Configuration
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|
|
@ -11,8 +11,8 @@ make sure your `git` executable is up-to-date (when branch or status information
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
PowerShell offers support for the [posh-git][poshgit] module for autocompletion, but it is disabled by default.
|
PowerShell offers support for the [posh-git][poshgit] module for autocompletion, but it is disabled by default.
|
||||||
To enable this, set `$env:POSH_GIT_ENABLED = $true` in your `$PROFILE`. This will also make use of the
|
To enable this, set `$env:POSH_GIT_ENABLED = $true` in your `$PROFILE` after initializing Oh My Posh.
|
||||||
[posh-git][poshgit] output rather than do additional work to get the git status.
|
This will also make use of the [posh-git][poshgit] output rather than do additional work to get the git status.
|
||||||
|
|
||||||
If you want to display the default [posh-git][poshgit] output, **do not** set the above environment variable
|
If you want to display the default [posh-git][poshgit] output, **do not** set the above environment variable
|
||||||
and add the following snippet after initializing Oh My Posh in your `$PROFILE`:
|
and add the following snippet after initializing Oh My Posh in your `$PROFILE`:
|
||||||
|
|
Loading…
Reference in a new issue