Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-PoshPrompt command is not recognized when updating to latest version #1573

Closed
1 task done
homie-desktop opened this issue Jan 13, 2022 · 13 comments
Closed
1 task done
Assignees
Labels
🐛 bug Something isn't working

Comments

@homie-desktop
Copy link

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

When updating using Update-Module -Name oh-my-posh -Scope CurrentUser -Force the prompt break saying "Set-PoshPrompt is not recognized as a cmdlet" for powershell core.

Theme

omp.atomicbit.json

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Oh My Posh is unable to download and store the latest version.
In case you installed using AllUsers and are a non-admin user,
please run the following command as an administrator:

Import-Module oh-my-posh

Original Error:

Program 'oh-my-posh.exe' failed to run: StandardOutputEncoding is only supported when standard output is redirected.At C:\Users\user_name\OneDrive\Documents\PowerShell\Modules\oh-my-posh\6.47.0\oh-my-posh.psm1:118 char:20
+     $poshVersion = & $executable --version
+                    ~~~~~~~~~~~~~~~~~~~~~~~.
Set-PoshPrompt: C:\Users\user_name\OneDrive\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:79
Line |
  79 |  Set-PoshPrompt -Theme "~/.omp.atomicbit.json"
     |  ~~~~~~~~~~~~~~
     | The term 'Set-PoshPrompt' 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.
@homie-desktop homie-desktop added the 🐛 bug Something isn't working label Jan 13, 2022
@JanDeDobbeleer
Copy link
Owner

duplicate of #1498

To resolve this, please install via winget for now

@wuranxu
Copy link

wuranxu commented Jan 14, 2022

duplicate of #1498

To resolve this, please install via winget for now

When I use winget/scoop, I also get some error.

I'm very raring to use the best terminal oh-my-posh , I can't stand using terminal without oh-my-posh any more. 😆

@JanDeDobbeleer
Copy link
Owner

@wuranxu have a look at the docs, when installing with winget the Set-PoshPrompt command isn't available (module only, but also deprecated there). You need to use the --init style invocation.

oh-my-posh --init --shell pwsh --config ~/jandedobbeleer.omp.json | Invoke-Expression

@wuranxu
Copy link

wuranxu commented Jan 14, 2022

@wuranxu have a look at the docs, when installing with winget the Set-PoshPrompt command isn't available (module only, but also deprecated there). You need to use the --init style invocation.

oh-my-posh --init --shell pwsh --config ~/jandedobbeleer.omp.json | Invoke-Expression

I'm so sorry, I haven't put my picture on the comment.

When I execute winget command, I got a unknown error(I know it is not caused by oh my posh)

D:\Users\rx.wu\Desktop> winget install JanDeDobbeleer.OhMyPosh
已找到 Oh My Posh [JanDeDobbeleer.OhMyPosh] 版本 6.47.0
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
Downloading https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v6.47.0/install-amd64.exe
执行此命令时发生意外错误:
InternetOpenUrl() failed.
0x80072efd : unknown error

// Found Oh my Posh [JanDeDobbeleer.OhMyPosh] Version 6.47.0
// 已找到 Oh My Posh [JanDeDobbeleer.OhMyPosh] 版本 6.47.0

@homie-desktop
Copy link
Author

@wuranxu have a look at the docs, when installing with winget the Set-PoshPrompt command isn't available (module only, but also deprecated there). You need to use the --init style invocation.

oh-my-posh --init --shell pwsh --config ~/jandedobbeleer.omp.json | Invoke-Expression

I'm so sorry, I haven't put my picture on the comment.

When I execute winget command, I got a unknown error(I know it is not caused by oh my posh)

D:\Users\rx.wu\Desktop> winget install JanDeDobbeleer.OhMyPosh
已找到 Oh My Posh [JanDeDobbeleer.OhMyPosh] 版本 6.47.0
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
Downloading https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v6.47.0/install-amd64.exe
执行此命令时发生意外错误:
InternetOpenUrl() failed.
0x80072efd : unknown error

// Found Oh my Posh [JanDeDobbeleer.OhMyPosh] Version 6.47.0 // 已找到 Oh My Posh [JanDeDobbeleer.OhMyPosh] 版本 6.47.0

try installing using scoop package manager instead, winget didn't work for me as well, but scoop did. If scoop is already installed type scoop install oh-my-posh3 then add the oh-my-posh --init --shell pwsh --config ~/jandedobbeleer.omp.json | Invoke-Expression in your powershell profile.

@wuranxu
Copy link

wuranxu commented Jan 14, 2022

try installing using scoop package manager instead, winget didn't work for me as well, but scoop did. If scoop is already installed type scoop install oh-my-posh3 then add the oh-my-posh --init --shell pwsh --config ~/jandedobbeleer.omp.json | Invoke-Expression in your powershell profile.

D:\Users\rx.wu\Desktop> Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
Initializing...
Downloading scoop...
Invoke-Expression: Exception calling "DownloadFile" with "2" argument(s): "The SSL connection could not be established, see inner exception."

Thanks very much.unfortunately I also can't install scoop, because of the error above.I tried Set-ExecutionPolicy RemoteSigned -scope CurrentUser, it doesn't work for me.
Is there anyone provides a green release version >.<.
I'm almost crazy now. 😢

@JanDeDobbeleer
Copy link
Owner

@wuranxu Winget should work, but maybe our friend Github had some issues (see here)

@wuranxu
Copy link

wuranxu commented Jan 14, 2022

@wuranxu Winget should work, but maybe our friend Github had some issues (see here)

Ok, there seems aren't some solution for me. I download scoop.zip by reading ps1 file, after i install scoop, there is a new error:

D:\Users\rx.wu> scoop install oh-my-posh3
WARN  Purging previous failed installation of oh-my-posh3.
Uninstalling 'oh-my-posh3' ().
'oh-my-posh3' was uninstalled.
Installing 'oh-my-posh3' (6.47.3) [64bit]
The SSL connection could not be established, see inner exception.
URL https://github.com/JanDeDobbeleer/oh-my-posh3/releases/download/v6.47.3/posh-windows-amd64.7z is not valid
D:\Users\rx.wu>

I don't known what to do now except feeling sadness for not using oh my posh.

@JanDeDobbeleer
Copy link
Owner

@wuranxu that's not the official package:

scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json

@wuranxu
Copy link

wuranxu commented Jan 15, 2022

@wuranxu that's not the official package:

scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json

I also tried it. It gives me the same error named not valid url.
Thanks a lot.

@JanDeDobbeleer
Copy link
Owner

@wuranxu something is definitely wrong on your machine. All Internet connections seem to fail. In that case, download the installer you can find on the releases here.

@wuranxu
Copy link

wuranxu commented Jan 17, 2022

@wuranxu something is definitely wrong on your machine. All Internet connections seem to fail. In that case, download the installer you can find on the releases here.

Thank you very much. 👍 👍 👍
I have installed oh-my-posh.When I execute it, the beautiful terminal occurred.
Now I may study how to make it works when I start powershell.
I will enjoy it!

>.< If I known that earlier, I can solve it more quickly.

Copy link

github-actions bot commented Mar 4, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants