-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Oh My Posh is unable to download and store the latest version #1498
Comments
@hjkta weird, you should be able to install in that case. Unless something else fails in the process, we do swallow the error in the assumption it's that specific use case. Where are your modules stored? |
@hjkta that makes more sense now, we've seen that before but my mind is a blank, let's see how we can fix that. |
@hjkta found it, in other cases this was due to character encoding and the following did resolve it: [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
Import-Module oh-my-posh |
@hjkta can you try again and run |
Same error for me unable to download. Removing and reinstalling the module still results in the error downloading the binary. |
Info: it appears it is now downloading to the wrong directory, placing it's binary in the module root of: C:\Program Files\WindowsPowerShell\Modules\oh-my-posh and not C:\Program Files\WindowsPowerShell\Modules\oh-my-posh\6.41.0 like it should. Probably why the themes then fail. Does this help? λ Import-Module oh-my-posh
|
The "Get-PoshCommand" is not correct:
does not take into account that the module resides in a subdir under "oh-my-posh" of the version number. This causes the one executable of "oh-my-posh.exe" to get dumped into the root folder not the module folder, and this erroneous path is then stored in $executable and throws off the other downloads. |
FOUR bugs:First bug line 83, typo on tmp$ remove the erroneous dollar sign on the replace:
Second bug: Expand-Archive does not have a param called DestinationPath, it's OutputPath Third bug: You used a forwardslash on line 2 "/themes" should be "\themes" Fourth bug: Destination "themes" does not exist and you are not creating it When I fix these four things and TEST it, it works. |
@CollinChaffin you have no idea how much the CAPS almost made me throw my phone out of the window. You act as if we do not test this, I run this on different machines and shells every day, even during holidays so next time, show some respect. Yes, we install this in the root folder. By design. A lot of users reported the executable took up a lot of space thus we decided to store it one time only. That's not an issue, it just works. Forward or backward slashes don't matter for Powershell on Windows, it just works, so that can't also be the issue. What is the issue is that you have another module installed that's overwriting the built in Expand-Archive functionality. See here. That's the only bug here. So not FOUR different issues as if I'm the biggest idiot on this planet. @hjkta you might also want to validate if you have the same issue due to having |
No offense but the caps were simply to draw attention to testing it. If you did, I am curious what system you tested on where 'tmp$' isn't a showstopping syntax error? You're right, the slash technically isn't an issue but the expand-archive param differs in 5.x vs 7.x but I ran it on both and the dollar sign in 'tmp' causes a terminating failure on all off them which is why I ask. Also expand-archive will not create the destination folder 'themes' in 5.x as shown here:
And for the record, I've been coding 34 yrs had someone simply capitalized the word TEST I would have laughed at myself and felt like an idiot and apologized for releasing it that way, not jumped down their throat. In hindsight, I should have put a smiley emoji next to it as it was just meant for you to slap your forehead. :) |
@JanDeDobbeleer this is result for
@CollinChaffin Actually this error happens only on my work PC, I also have the same module on my home PC installed under Also I don't have |
@hjkta no, definitely not 😁 Thanks for this one, let's see if we can get to the bottom of this. A less general catch block might be useful to print the actual error. |
@hjkta I pushed an update that should print the original error, that should show us what the issue is. |
@JanDeDobbeleer I tried to reinstall, this error is gone, but the first one still exists:
|
@hjkta give it a moment, I don't think it's through just yet 😅 |
@hjkta you should be able to install 6.41.1 now |
|
Unfortunately it didn't help. I tried both options and no result for me. |
Have the same. If it helps, I have tried with v6.42.4 and v5.19.1 - both displayed this. the bin and themes folders could not be downloaded, the PSM1 and PSD1 file did. PowerShell Version Table
Name Value
---- -----
PSVersion 5.1.19041.1320
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1320
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PowerShell Host
Name : ConsoleHost
Version : 5.1.19041.1320
InstanceId : 49733c8f-c1ec-471f-b15d-800288dff3ed
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-GB
CurrentUICulture : en-GB
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
Installed NET Frameworks
PSChildName Version Release
----------- ------- -------
v2.0.50727 2.0.50727.4927
v3.0 3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation 3.0.6920.4902
v3.5 3.5.30729.4926
Client 4.8.04084 528372
Full 4.8.04084 528372
Client 4.0.0.0
I can try updating to 4.0 and 5.0 respectively to see where it starts, if that helps |
@DEberhardt staying on 3 isn't advised, it's a bit old. You can always install via Winget/Scoop, that will always work. Probably it's indeed a security setting, there's so much strange things happening with modules I'm close to dropping that installation method in favor of Winget/Scoop. |
I think I know why this happens. Controlled Folder Action will disallow access to Documents. As this probably is a company security setting we can't work around this. I'll try to find which folders are open to write to. |
maybe, I can't import oh-my-posh in my company's pc.There is some limits for folder permission(write).So can you change or support it.I work sadly because of using default windows terminal without oh-my-posh!!! 😞
|
This one's on my list to try to fix this evening. |
So, to reduce the overhead which a module introduces (as it always did include too many cross platform binaries) everything is now stored inside |
@hjkta I feel this is all connected to policies rather than anything we can still do from oh-my-posh. I'll try to reproduce, but it's been very challenging so far. |
Hello, can confirm that it downloaded fine today on my work machine - v6.51.0 - Thank you! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This might need to be a new issue but there should really be an option for those in corporate environments. Having a module downloaded and then it immediately goes and downloads another exe would not make my security team happy. This was never an issue in older versions, but I'm now setting this up on a new machine. What changed? |
@nkasco this was by user request as due to PowerShell's nature it always keeps older versions as well resulting in a lot of storage overhead. This way, the PowerShell module is also only a wrapper around the executable. In case this is an issue in corporate environments, please move to winget/scoop as an alternative or add the binary manually to your system and PATH. |
@JanDeDobbeleer Thanks for the response, in my case only downloads from PS Gallery are open. Everything else gets auto-blocked by the proxy. I suspect this might be the case for some others in corporate environments. |
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. |
Code of Conduct
What happened?
After
Install-Module oh-my-posh -Scope CurrentUser
and thenImport-Module oh-my-posh
in my ps config I get this error. Have no idea what should I do to fix that.Theme
This happens even before using the theme.
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output
The text was updated successfully, but these errors were encountered: