JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.21k stars 2.37k forks source link

Setting POSH_AZURE_ENABLED breaks Oh My Posh #4735

Closed LiquidPT closed 7 months ago

LiquidPT commented 7 months ago

Code of Conduct

What happened?

I just updated OhMyPosh to 19.11.7 via Winget, and my prompt became PS>. Running init at the prompt showed the OMP prompt again, but closing and reopening Terminal showed PS>. Opened the PowerShell profile, and commented out the line that says $env:POSH_AZURE_ENABLED = $true and the prompt works again (but without my Azure info).

Here is my PowerShell_profile.ps1 contents:

Import-Module -Name Terminal-Icons

oh-my-posh init pwsh --config "$env:OneDriveConsumer/WindowsTerminal/liquidpt.omp.json" | Invoke-Expression
$env:POSH_AZURE_ENABLED = $true

Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows

Theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "final_space": true,
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "path",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "background": "#91ddff",
          "foreground": "#100e23",
          "leading_diamond": "\ue0b6",
          "trailing_diamond": "\ue0b0",
          "template": " \uf115 {{ .Path }} ",
          "properties": {
            "style": "folder"
          }
        },
        {
            "type": "git",
            "style": "powerline",
            "powerline_symbol": "",
            "foreground": "#193549",
            "background": "#ffeb3b",
            "background_templates": [
              "{{ if or (.Working.Changed) (.Staging.Changed) }}#FFEB3B{{ end }}",
              "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#FFCC80{{ end }}",
              "{{ if gt .Ahead 0 }}#B388FF{{ end }}",
              "{{ if gt .Behind 0 }}#B388FB{{ end }}"
            ],
            "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }}  {{ .StashCount }}{{ end }}",
            "properties": {
              "fetch_status": true,
              "fetch_stash_count": true,
              "fetch_upstream_icon": true,
              "untracked_modes": {
                "/Users/user/Projects/oh-my-posh/": "no"
              }
            }
          },
        {
            "type": "az",
            "style": "powerline",
            "powerline_symbol": "",
            "foreground": "#000000",
            "background": "#9ec3f0",
            "template": " \uebd8 {{ .Name }}"
        },
        {
          "type": "root",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "foreground": "#ffffff",
          "background": "#ffff66",
          "template": " \uf0e7 "
        },
        {
            "background": "#ff8080",
            "foreground": "#ffffff",
            "powerline_symbol": "\ue0b0",
            "style": "powerline",
            "template": " {{ .Meaning }} ",
            "type": "exit"
        }
      ]
    }
  ]
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 19.11.7

Shell: pwsh (7.4.1)

Prompt:

  ~ 

Segments:

ConsoleTitle(false)                       -   0 ms
Path(true)                                -   4 ms
Git(false)                                -  17 ms
Az(false)                                 -  14 ms
Root(false)                               -   1 ms
Exit(false)                               -   4 ms

Run duration: 31.2122ms

Cache path: C:\Users\Liqui\AppData\Local\oh-my-posh

Config path: C:\Users\Liqui\OneDrive\WindowsTerminal\liquidpt.omp.json

Logs:

[DEBUG] 17:53:57.676 shell.go:Getenv:398 → NO DATA
[TRACE] 17:53:57.676 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 17:53:57.676 shell.go:Getenv:398 → C:\Users\Liqui\AppData\Local
[TRACE] 17:53:57.676 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 17:53:57.676 shell_windows.go:CachePath() - 0s
[DEBUG] 17:53:57.677 shell.go:Getenv:398 → C:\Users\Liqui\OneDrive\WindowsTerminal\liquidpt.omp.json
[TRACE] 17:53:57.677 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 17:53:57.677 shell.go:Shell:663 → no shell name provided in flags, trying to detect it
[DEBUG] 17:53:57.689 shell.go:Shell:671 → process name: pwsh.exe
[TRACE] 17:53:57.689 shell.go:Shell() - 11.7194ms
[TRACE] 17:53:57.689 shell.go:resolveConfigPath() - 11.7194ms
[TRACE] 17:53:57.689 shell.go:Init() - 12.3418ms
[TRACE] 17:53:57.689 shell.go:Flags() - 0s
[TRACE] 17:53:57.690 config.go:loadConfig() - 955.8µs
[TRACE] 17:53:57.690 shell.go:Flags() - 0s
[DEBUG] 17:53:57.690 shell.go:Getenv:398 → NO DATA
[TRACE] 17:53:57.690 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 17:53:57.690 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[DEBUG] 17:53:57.690 shell_windows.go:WindowsRegistryKeyValue:217 → ColorizationColor(DWORD): 0xC410893E
[TRACE] 17:53:57.690 shell.go:Shell() - 0s
[DEBUG] 17:53:57.690 shell.go:Getenv:398 → 7.4.1
[TRACE] 17:53:57.690 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 17:53:57.690 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 17:53:57.690 text.go:Render:70 → Rendering template:
[DEBUG] 17:53:57.690 shell.go:Getenv:398 → NO DATA
[TRACE] 17:53:57.690 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 17:53:57.690 shell.go:Getenv:398 → NO DATA
[TRACE] 17:53:57.690 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 17:53:57.690 shell.go:Flags() - 0s
[TRACE] 17:53:57.690 shell.go:Flags() - 0s
[TRACE] 17:53:57.690 shell.go:Shell() - 0s
[TRACE] 17:53:57.690 shell.go:Shell() - 0s
[TRACE] 17:53:57.690 shell.go:Flags() - 0s
[DEBUG] 17:53:57.690 properties.go:GetString:28 → {{ .Code }}
[TRACE] 17:53:57.690 shell.go:GOOS() - 0s
[TRACE] 17:53:57.690 shell.go:Flags() - 0s
[TRACE] 17:53:57.690 shell.go:Flags() - 0s
[TRACE] 17:53:57.690 shell.go:Flags() - 0s
[TRACE] 17:53:57.690 shell.go:Flags() - 0s
[DEBUG] 17:53:57.691 shell.go:Pwd:428 → C:\Users\Liqui
[TRACE] 17:53:57.691 shell.go:Pwd() - 0s
[DEBUG] 17:53:57.691 shell_windows.go:58 → C:\Users\Liqui
[TRACE] 17:53:57.691 shell.go:GOOS() - 0s
[DEBUG] 17:53:57.691 segment.go:SetEnabled:526 → Segment: Git
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[DEBUG] 17:53:57.692 shell.go:Getenv:398 → C:\Users\Liqui\AppData\Local
[TRACE] 17:53:57.692 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 17:53:57.692 shell.go:Pwd() - 0s
[DEBUG] 17:53:57.692 shell_windows.go:58 → C:\Users\Liqui
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:Pwd() - 0s
[DEBUG] 17:53:57.692 segment.go:SetEnabled:526 → Segment: Root
[DEBUG] 17:53:57.692 shell_windows.go:58 → C:\Users\Liqui
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[DEBUG] 17:53:57.692 segment.go:SetEnabled:526 → Segment: Path
[TRACE] 17:53:57.692 shell.go:Pwd() - 0s
[TRACE] 17:53:57.692 shell.go:Shell() - 0s
[TRACE] 17:53:57.692 shell.go:Flags() - 0s
[TRACE] 17:53:57.692 shell.go:Pwd() - 1.0011ms
[DEBUG] 17:53:57.692 shell_windows.go:58 → C:\Users\Liqui
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell_windows.go:Root() - 0s
[DEBUG] 17:53:57.692 segment.go:SetEnabled:526 → Segment: Exit
[TRACE] 17:53:57.692 shell.go:StatusCodes() - 0s
[DEBUG] 17:53:57.692 text.go:Render:70 → Rendering template: {{ .Code }}
[TRACE] 17:53:57.692 shell.go:Pwd() - 0s
[DEBUG] 17:53:57.692 shell_windows.go:58 → C:\Users\Liqui
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[DEBUG] 17:53:57.692 segment.go:SetEnabled:526 → Segment: Az
[DEBUG] 17:53:57.692 properties.go:GetString:28 → first_match
[DEBUG] 17:53:57.692 shell.go:Getenv:398 → NO DATA
[TRACE] 17:53:57.692 shell.go:Getenv(AZURE_CONFIG_DIR) - 0s
[DEBUG] 17:53:57.692 shell_windows.go:58 → C:\Users\Liqui
[DEBUG] 17:53:57.692 shell_windows.go:58 → C:\Users\Liqui
[DEBUG] 17:53:57.692 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 17:53:57.692 properties.go:GetString:28 → 
[DEBUG] 17:53:57.692 properties.go:GetString:28 → 
[DEBUG] 17:53:57.692 shell_windows.go:58 → C:\Users\Liqui
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[DEBUG] 17:53:57.692 properties.go:GetString:28 → ~
[DEBUG] 17:53:57.692 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 17:53:57.692 shell.go:PathSeparator() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[DEBUG] 17:53:57.692 shell.go:HasFilesInDir:478 → true
[TRACE] 17:53:57.692 shell.go:HasFilesInDir(azureProfile.json) - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:PathSeparator() - 0s
[TRACE] 17:53:57.692 shell.go:PathSeparator() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:PathSeparator() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:PathSeparator() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.692 shell.go:GOOS() - 0s
[TRACE] 17:53:57.693 shell.go:PathSeparator() - 0s
[TRACE] 17:53:57.693 shell.go:Pwd() - 0s
[TRACE] 17:53:57.693 shell_windows.go:IsWsl() - 0s
[TRACE] 17:53:57.693 shell.go:StackCount() - 0s
[TRACE] 17:53:57.694 shell_windows.go:Root() - 0s
[TRACE] 17:53:57.694 shell.go:Shell() - 0s
[TRACE] 17:53:57.694 shell.go:StatusCodes() - 0s
[TRACE] 17:53:57.694 shell_windows.go:IsWsl() - 0s
[DEBUG] 17:53:57.694 shell.go:TemplateCache:844 → environment: [ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\Liqui\AppData\Roaming CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=BOKATAN ComSpec=C:\WINDOWS\system32\cmd.exe CONDA_PROMPT_MODIFIER=False DriverData=C:\Windows\System32\Drivers\DriverData HOMEDRIVE=C: HOMEPATH=\Users\Liqui LOCALAPPDATA=C:\Users\Liqui\AppData\Local LOGONSERVER=\\BOKATAN NUMBER_OF_PROCESSORS=8 OneDrive=C:\Users\Liqui\OneDrive OneDriveConsumer=C:\Users\Liqui\OneDrive OS=Windows_NT Path=C:\Program Files\WindowsApps\Microsoft.PowerShell_7.4.1.0_x64__8wekyb3d8bbwe;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Users\Liqui\AppData\Local\Microsoft\WindowsApps;;C:\Users\Liqui\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Liqui\.dotnet\tools;C:\Users\Liqui\AppData\Local\Programs\Fiddler;C:\Users\Liqui\.dotnet\tools;C:\Users\Liqui\AppData\Local\Microsoft\WindowsApps;C:\Users\Liqui\AppData\Local\Programs\oh-my-posh\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL POSH_AZURE_ENABLED=True POSH_GIT_ENABLED=False POSH_INSTALLER=winget POSH_PID=16476 POSH_SHELL_VERSION=7.4.1 POSH_THEME=C:\Users\Liqui\OneDrive\WindowsTerminal\liquidpt.omp.json POSH_THEMES_PATH=C:\Users\Liqui\AppData\Local\Programs\oh-my-posh\themes POWERLINE_COMMAND=oh-my-posh PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 126 Stepping 5, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=7e05 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PSModulePath=C:\Users\Liqui\OneDrive\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\windowsapps\microsoft.powershell_7.4.1.0_x64__8wekyb3d8bbwe\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules PUBLIC=C:\Users\Public SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\Users\Liqui\AppData\Local\Temp TMP=C:\Users\Liqui\AppData\Local\Temp USERDOMAIN=BOKATAN USERDOMAIN_ROAMINGPROFILE=BOKATAN USERNAME=Liqui USERPROFILE=C:\Users\Liqui windir=C:\WINDOWS WSLENV=WT_SESSION:WT_PROFILE_ID: WT_PROFILE_ID={574e775e-4f2a-5b96-ac1e-a2962a402336} WT_SESSION=061b8466-68a7-4839-b633-0a5d72ec7810]
[TRACE] 17:53:57.694 shell.go:Pwd() - 0s
[DEBUG] 17:53:57.694 shell_windows.go:58 → C:\Users\Liqui
[TRACE] 17:53:57.694 shell.go:GOOS() - 0s
[TRACE] 17:53:57.694 shell.go:GOOS() - 0s
[TRACE] 17:53:57.694 shell.go:GOOS() - 0s
[TRACE] 17:53:57.694 shell.go:GOOS() - 0s
[TRACE] 17:53:57.694 shell.go:GOOS() - 0s
[TRACE] 17:53:57.694 shell.go:GOOS() - 0s
[TRACE] 17:53:57.694 shell.go:GOOS() - 0s
[TRACE] 17:53:57.694 shell.go:GOOS() - 0s
[DEBUG] 17:53:57.694 shell.go:User:563 → Liqui
[TRACE] 17:53:57.694 shell.go:User() - 0s
[DEBUG] 17:53:57.694 shell.go:Host:575 → BOKATAN
[TRACE] 17:53:57.694 shell.go:Host() - 0s
[TRACE] 17:53:57.694 shell.go:GOOS() - 0s
[DEBUG] 17:53:57.694 shell.go:Getenv:398 → NO DATA
[TRACE] 17:53:57.694 shell.go:Getenv(SHLVL) - 0s
[TRACE] 17:53:57.694 shell.go:TemplateCache() - 0s
[DEBUG] 17:53:57.694 properties.go:GetBool:22 → always_enabled: false
[DEBUG] 17:53:57.694 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 17:53:57.694 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 17:53:57.694 win32_windows.go:isWriteable:311 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 17:53:57.694 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 17:53:57.694 shell_windows.go:DirIsWritable() - 1.0001ms
[TRACE] 17:53:57.694 shell.go:TemplateCache() - 0s
[DEBUG] 17:53:57.704 shell.go:FileContent:537 → {"installationId": "c4de4f49-d9c9-11ee-9657-58961d99ba19"}
[TRACE] 17:53:57.704 shell.go:FileContent(C:\Users\Liqui\.azure\azureProfile.json) - 12.6273ms
[DEBUG] 17:53:57.704 shell.go:Getenv:398 → NO DATA
[TRACE] 17:53:57.704 shell.go:Getenv(POSH_AZURE_SUBSCRIPTION) - 0s
[DEBUG] 17:53:57.706 shell.go:CommandPath:615 → C:\Program Files\Git\cmd\git.exe
[TRACE] 17:53:57.706 shell.go:CommandPath(git.exe) - 14.6252ms
[TRACE] 17:53:57.706 shell.go:HasCommand(git.exe) - 14.6252ms
[TRACE] 17:53:57.706 shell.go:Pwd() - 0s
[ERROR] 17:53:57.706 shell.go:HasParentFilePath:759 → CreateFile .git: The system cannot find the file specified.
[TRACE] 17:53:57.707 shell.go:HasParentFilePath(.git) - 0s
[DEBUG] 17:53:57.707 properties.go:GetBool:22 → fetch_bare_info: false
[DEBUG] 17:53:57.707 text.go:Render:70 → Rendering template:   {{ .Path }}
[TRACE] 17:53:57.707 shell.go:TemplateCache() - 0s
[TRACE] 17:53:57.707 shell.go:Shell() - 0s
[DEBUG] 17:53:57.707 text.go:Render:70 → Rendering template: powerline
[DEBUG] 17:53:57.707 text.go:Render:70 → Rendering template: powerline
[DEBUG] 17:53:57.707 text.go:Render:70 → Rendering template: powerline
[DEBUG] 17:53:57.707 text.go:Render:70 → Rendering template: powerline
[DEBUG] 17:53:57.707 text.go:Render:70 → Rendering template: powerline
[TRACE] 17:53:57.707 shell.go:Shell() - 0s
[TRACE] 17:53:57.707 shell.go:Shell() - 0s
[TRACE] 17:53:57.707 shell.go:Shell() - 0s
[DEBUG] 17:53:57.707 shell.go:Getenv:398 → C:\Users\Liqui\AppData\Local
[TRACE] 17:53:57.707 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 17:53:57.707 shell_windows.go:CachePath() - 0s
[TRACE] 17:53:57.707 shell.go:Flags() - 0s
JanDeDobbeleer commented 7 months ago

@LiquidPT you don't have the AZ module installed, that's why it fails. We also have that switch due to fetching module availability taking too long.

LiquidPT commented 7 months ago

I do have the AZ module installed. When I type az at the prompt I get the AZ help

JanDeDobbeleer commented 7 months ago

@LiquidPT do you import that module AFTER loading oh-my-posh? Because that's all that switch does. If you check the contents of the $error variable, you will see that error.

LiquidPT commented 7 months ago

What do you mean by "import that module"?

I'm using the exact same PowerShell profile script and theme on another machine and it works fine.

As it turns out, it's also got the same version of OMP, PowerShell, and AZ CLI, so I don't actually know what's going on

LiquidPT commented 7 months ago

Error: The term 'Get-AzContext' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Ah, I'm guessing this is a case of Azure having multiple PowerShell modules. I have the newer Microsoft.AzureCLI installed on this machine, but I'm guessing the segment needs one of the others. I will look into this.

LiquidPT commented 7 months ago

SOLVED: This segment requires the "Az" PowerShell module. Not the AzureCLI (which uses the command az, and I confused with the Az PowerShell module) nor the older AzureRM Powershell Module

All working now

JanDeDobbeleer commented 7 months ago

@LiquidPT the segment doesn't require it, if you have the AZ CLI, that will also work. You simply shouldn't set $env:POSH_AZURE_ENABLED = $true in that case.

github-actions[bot] commented 4 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.