Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Edyoung/issue 349 catastrophic #407

Merged
merged 3 commits into from
Jan 24, 2019
Merged

Conversation

edyoung
Copy link
Contributor

@edyoung edyoung commented Jan 24, 2019

Should resolve #349 and #401

When a module is installed, we store the SourceLocation at that time. When you run Update-Module, it looks for a source which matches that saved location. When the two do not match, the update fails. The expected URL for the PowerShellGallery is https://www.powershellgallery.com/api/v2 , but some operation (it is still not clear exactly what) has led to some users having the gallery URL as https://www.powershellgallery.com/api/v2/ - with a trailing /.

This is treated as the same URL by the web server but is different-enough that Update-Module sees the saved and current repository sources as different.

This change makes it so that when we look for a repository by URL/path we ignore trailing / or \ characters when comparing them. This should resolve the practical issues people are hitting with Update-Module.

@edyoung edyoung requested a review from alerickson January 24, 2019 00:57
@sg1970
Copy link

sg1970 commented Mar 1, 2019

Can someone please let me know if this issue is fixed or not ? If fixed where/what is the fix ? From reading the associated thread it appears that the issue is due to the slash at the end of the URL ( https://www.powershellgallery.com/api/v2 ) but whether I have a slash or not it doesn't seem to make any difference for me and I get the same error.

@edyoung
Copy link
Contributor Author

edyoung commented Mar 1, 2019

A fix exists but a binary package containing that fix has not yet been released - hopefully very soon now.

@sg1970
Copy link

sg1970 commented Mar 4, 2019

Thanks

@sg1970
Copy link

sg1970 commented Mar 14, 2019

A fix exists but a binary package containing that fix has not yet been released - hopefully very soon now.

Any word on this yet ?

@edyoung
Copy link
Contributor Author

edyoung commented Mar 15, 2019

Use PowerShellGet 2.1.0 or above, out now wherever PowerShell modules are sold ;-)

@sg1970
Copy link

sg1970 commented Mar 16, 2019

Thanks it works !

@Dyermull
Copy link

Use PowerShellGet 2.1.0 or above, out now wherever PowerShell modules are sold ;-)

Respectfully, how do I update PowerShellGet to the latest version when the Install-Module functionality is broken and running Update-Module -Name PowerShellGet produces an error "Update-Module : Module 'powershellget' was not installed by using Install-Module, so it cannot be updated." (Server 2012 R2 shipped with WMF 4.0 and I upgraded to WMF 5.1 a while back).

It kind of feels like a catch-22. I've been struggling through issues with PowerShellGet's Install-Module for a couple of weeks until I came across this thread and it's relatives, but still haven't been able to fix it. Any advice in getting PowerShellGet updated in my situation would be much appreciated.

@alerickson
Copy link
Member

@Dyermull Can you please file an issue for this with repro steps? I'll take a look at this

@Dyermull
Copy link

@alerickson Will do, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Catastrophic terminating error for PSGallery-installed "Update-Module" due to repo URL syntax change
5 participants