Install Oh My Posh error: Oh My Posh is unable to download and store the latest version and The term 'Set-PoshPrompt' is not recognized as a name of a cmdlet, function, script | file, or executable program #16124

Closed
opened 2026-01-31 04:58:10 +00:00 by claunia · 8 comments
Owner

Originally created by @ghost on GitHub (Dec 15, 2021).

I have install git-posh and oh-my-posh:
Install-Module git-posh -Scope CurrentUser -Force
Install-Module oh-my-posh -Scope CurrentUser -Force
This is $PROFILE:
image
This is error:
image

Originally created by @ghost on GitHub (Dec 15, 2021). <!-- Briefly describe which document needs to be corrected and why. --> I have install git-posh and oh-my-posh: `Install-Module git-posh -Scope CurrentUser -Force` `Install-Module oh-my-posh -Scope CurrentUser -Force` This is $PROFILE: ![image](https://user-images.githubusercontent.com/89201988/146150806-91c6ddf1-92e4-4a6f-9f97-b0224fc58a04.png) This is error: ![image](https://user-images.githubusercontent.com/89201988/146150884-149a58e3-b132-4de2-9312-06351880a919.png)
Author
Owner

@ghost commented on GitHub (Dec 15, 2021):

How to fix it. Pls!

@ghost commented on GitHub (Dec 15, 2021): How to fix it. Pls!
Author
Owner

@zadjii-msft commented on GitHub (Dec 15, 2021):

Which version of oh-my-posh are you using? This is kinda the inverse of #9237. You may want to try Set-Theme instead of Set-PoshPrompt.

There's also a TON of discussion over on our docs repo: https://github.com/MicrosoftDocs/terminal/issues?q=is%3Aissue+label%3Apowerline+

@zadjii-msft commented on GitHub (Dec 15, 2021): Which version of oh-my-posh are you using? This is kinda the inverse of #9237. You may want to try `Set-Theme` instead of `Set-PoshPrompt`. There's also a TON of discussion over on our docs repo: https://github.com/MicrosoftDocs/terminal/issues?q=is%3Aissue+label%3Apowerline+
Author
Owner

@ghost commented on GitHub (Dec 15, 2021):

Which version of oh-my-posh are you using? This is kinda the inverse of #9237. You may want to try Set-Theme instead of Set-PoshPrompt.

There's also a TON of discussion over on our docs repo: https://github.com/MicrosoftDocs/terminal/issues?q=is%3Aissue+label%3Apowerline+

I want to fix the first error: Oh My Posh is unable to download and store the latest version.
I use version 6.34

@ghost commented on GitHub (Dec 15, 2021): > Which version of oh-my-posh are you using? This is kinda the inverse of #9237. You may want to try `Set-Theme` instead of `Set-PoshPrompt`. > > There's also a TON of discussion over on our docs repo: https://github.com/MicrosoftDocs/terminal/issues?q=is%3Aissue+label%3Apowerline+ I want to fix the first error: Oh My Posh is unable to download and store the latest version. I use version 6.34
Author
Owner

@ghost commented on GitHub (Dec 15, 2021):

I install oh-my-posh version 2.0.412 and i fix the second error.
The first error is very suck

@ghost commented on GitHub (Dec 15, 2021): I install oh-my-posh version 2.0.412 and i fix the second error. The first error is very suck
Author
Owner

@zadjii-msft commented on GitHub (Dec 15, 2021):

Is your current account an admin account? Did you try running Import-Module oh-my-posh as an admin?

@zadjii-msft commented on GitHub (Dec 15, 2021): Is your current account an admin account? Did you try running `Import-Module oh-my-posh` as an admin?
Author
Owner

@ghost commented on GitHub (Dec 19, 2021):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Dec 19, 2021): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@lujomu commented on GitHub (Dec 22, 2021):

Got the same error.

In my case the problem is, I have the PSCX module (https://github.com/Pscx/Pscx) installed, which exports its own 'Expand-Archive' command and occludes the built-in one from the Microsoft.PowerShell.Archive module.

PS D:> Get-Command 'Expand-Archive'

CommandType     Name                Version    Source
-----------     ----                -------    ------
Cmdlet          Expand-Archive      3.3.2      Pscx

Apparently the name clash will be resolved in the next release (https://github.com/Pscx/Pscx/blob/master/ReleaseNotes.txt).

In the meantime, importing the Microsoft.PowerShell.Archive module right before invoking/importing oh-my-posh should work around this issue.

Edit: Apparently you have to delete the already downloaded executable, or otherwise the theme download won't initiate:

Remove-Item "$env:POSH_PATH\oh-my-posh.exe"
Import-Module 'Microsoft.PowerShell.Archive'
Import-Module 'oh-my-posh' -Force
@lujomu commented on GitHub (Dec 22, 2021): Got the same error. In my case the problem is, I have the PSCX module (https://github.com/Pscx/Pscx) installed, which exports its own 'Expand-Archive' command and occludes the built-in one from the Microsoft.PowerShell.Archive module. PS D:> Get-Command 'Expand-Archive' CommandType Name Version Source ----------- ---- ------- ------ Cmdlet Expand-Archive 3.3.2 Pscx Apparently the name clash will be resolved in the next release (https://github.com/Pscx/Pscx/blob/master/ReleaseNotes.txt). In the meantime, importing the Microsoft.PowerShell.Archive module right before invoking/importing oh-my-posh should work around this issue. Edit: Apparently you have to delete the already downloaded executable, or otherwise the theme download won't initiate: Remove-Item "$env:POSH_PATH\oh-my-posh.exe" Import-Module 'Microsoft.PowerShell.Archive' Import-Module 'oh-my-posh' -Force
Author
Owner

@ghost commented on GitHub (Dec 26, 2021):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Dec 26, 2021): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16124