-
Notifications
You must be signed in to change notification settings - Fork 189
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
error trying to install package provider (for powershell core) #477
Comments
@pwm1234 thanks for opening this issue, I noticed that your PackageManagement is not the latest version so this could be contributing to the issue, are you able to |
No I get an error running update-module packagemanagement
|
@pwm1234 thanks for trying that, we are planning to investigate this issue further, one potential workaround is by manually downloading the package provider, or if you have it saved on another machine copying over the dll |
Can you tell me how to manually download the package provider? Right now I am completely stuck and unable to do anything with powershell core 6 on my windows 10 laptop. |
I'm having a similar issue and I'm not sure if that's a powershell core issue or if I'm doing anything wrong. Trying to install (and even to simply find) ChocolateyGet provider fails in powershell core and succeeds in windows powershell: Core: VERBOSE: Using the provider 'Bootstrap' for searching packages. VERBOSE: Finding the package 'Bootstrap::FindPackage' 'ChocolateyGet VERBOSE: Using the provider 'PowerShellGet' for searching packages. VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provi der 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.co m/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api /v2/FindPackagesById()?id='ChocolateyGet'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'Chocolat eyGet'.
Find-PackageProvider : No match was found for the specified search criteria and package name 'ChocolateyGet'. Try Get-PackageSource to see all available registered package sources.
At line:1 char:1
+ Find-PackageProvider ChocolateyGet -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.PowerShel\u2026FindPackageProvider:FindPackageProvider) [Find-PackageProvider], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackageProvider vs Windows PowerShell: VERBOSE: Using the provider 'Bootstrap' for searching packages.
VERBOSE: Finding the package 'Bootstrap::FindPackage' 'ChocolateyGet','','','''.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='ChocolateyGet'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'ChocolateyGet'.
Name Version Source Summary
---- ------- ------ -------
ChocolateyGet 1.0.0.1 PSGallery An PowerShell OneGet provider that discovers packages from https://www.c... Please, let me know if I can provider any additional info. Powershell core version is 6.2.4, Windows 1909 18363.628 P.S. I'm just noticing a weird error output for powershell core: I'm getting this both in Windows Terminal as well as in PowerShell's standalone window |
And just in general, windows powershell shows way more package providers when executing find-packageprovider than Core. Might it be that the package providers showing up in windows powershell and not in powershell core require full .NET and not .NET core? |
I've got a similar issue in #488 and it's just going in circles with no solution to be found. |
I have never resolved my original problems. I have given up on PS Core for the time being. |
You could try latest preview version. |
My guess is that many of the package providers target windows powershell and not powershell core, that's why they're not getting listed. Not sure how it can be solved, since most of those package providers offer windows-only packages and it doesn't make sense to port them over to other systems. |
I will plead ignorance on this one. I was just trying to use powershell core across the board so that I did not use powershell on windows and bash on linux. I thought I would use powershell core everywhere. But when I did, I came across some package that needed to be installed (on windows) and simply executing this command So I gave up on the pipedream of using powershell core as a multiplatform shell. |
@pwm1234 I was curious because for general package management (used in a generic sense) you can use PowerShellGet... we're working on a new version that will remove its dependency on PackageManagement to circumvent issues like this. However if you're trying to install another package provider that takes a dependency on PackageManagement, it might be a little trickier. It sounds like you probably fall into the former category? In which case you can try testing out the preview version of PowerShellGet v3. It still has limited capability but I'm working flushing it out and we should have a fully functioning preview in the next 2 months. |
Thank you for your help. I will admit to being a fairly dumb powershell user. I saw that powershell core was available on windows and linux, and I need a shell I can use on both. Plus, I (thought) I saw that powershell core was ready to replace powershell, so I thought I would try it first on windows. I guess all of this was a little premature. I do, however, look forward to using powershell core with full functionality on both windows and linux. |
I've been checking in on this issue for a while and finally have a workaround that worked on my machine. Just run this in Core: Get-ChildItem -Path $env:PSModulePath.Split(';') -Filter 'PackageManagement' -Directory -ErrorAction SilentlyContinue |
Get-ChildItem -Directory |
Where-Object -Property Name -Match '\d*\.\d*\.\d*' |
Get-ChildItem -Filter 'netstandard2.0' -Directory |
ForEach-Object -Process {
foreach ($clr in 'fullclr', 'coreclr') {
Copy-Item -Path $_.FullName -Destination "$($_.Parent)\$clr" -Recurse -ErrorAction SilentlyContinue
}
} |
Thanks @thisjustin816 this gives me more insight into the original problem itself... I've never been able to repro this issue. Thanks for sharing your workaround. |
I found this: PowerShell/PowerShellGetv2#605 |
As another workaround for this issue, if trying to install the NuGet package provider, you can retrieve the file this location: 'https://onegetcdn.azureedge.net/providers/Microsoft.PackageManagement.NuGetProvider-2.8.5.208.dll' |
This was a bug fixed in PowerShell 7.1. See PowerShell/PowerShell#12203 |
PS Version: 7.2.2 |
@mndhkr can you share the commands you're running and logs? |
Same problem in 7.2.3 too. I see it in both Windows powershell and powershell core. I am trying to update DBATOOLS module and get this...
If I run
|
Exactly as chuckh1958 posted above - This issue has been closed, but still appears to be an issue even now that we're on PS 7.2.4 |
This lead me in the direction of fixing this problem for me in 7.2.5. $env:PSModulePath had "C:\Program Files\WindowsPowerShell\Modules" before "C:\Program Files\PowerShell\7\Modules". When I made the v7 path the first item I was able to install modules again. Strangely, attempting to Update-Module PackageManagement reports an issue, but otherwise I experience no issues. PS > Update-Module PackageManagement
Update-Module: Module 'PackageManagement' was not installed by using Install-Module, so it cannot be updated. |
Thank you very much! I changed the order of the paths in the windows environment variables and for the first time in months I am able to install and update modules!
From: pickles ***@***.***>
Sent: Friday, June 24, 2022 2:35 PM
To: OneGet/oneget ***@***.***>
Cc: Hamilton, Chuck ***@***.***>; Comment ***@***.***>
Subject: Re: [OneGet/oneget] error trying to install package provider (for powershell core) (#477)
I've been checking in on this issue for a while and finally have a workaround that worked on my machine. Just run this in Core:
Get-ChildItem -Path $env:PSModulePath.Split(';') -Filter 'PackageManagement' -Directory -ErrorAction SilentlyContinue |
Get-ChildItem -Directory |
Where-Object -Property Name -Match '\d*\.\d*\.\d*' |
Get-ChildItem -Filter 'netstandard2.0' -Directory |
ForEach-Object -Process {
foreach ($clr in 'fullclr', 'coreclr') {
Copy-Item -Path $_.FullName -Destination "$($_.Parent)\$clr" -Recurse -ErrorAction SilentlyContinue
}
}
This lead me in the direction of fixing this problem for me in 7.2.5. $env:PSModulePath had "C:\Program Files\WindowsPowerShell\Modules" before "C:\Program Files\PowerShell\7\Modules". When I made the v7 path the first item I was able to install modules again.
Strangely attempting to Update-Module PackageManagement reports an issue, but otherwise I experience no issues.
PS > Update-Module PackageManagement Update-Module: Module 'PackageManagement' was not installed by using Install-Module, so it cannot be updated.
—
Reply to this email directly, view it on GitHub<#477 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AT6JVUDPITTU7Q4AVHW3EUDVQX5T5ANCNFSM4JECF42A>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
I have this problem in the latest Powershell Core hsoted in .NET Core application. Nothing worked at all.... just turning in cykles. |
I am also seeing this in powershell 7.3.4, although the error is a bit different.
I tried installing the dll listed above in both the mentioned locations, but no success If I run |
I just had an insight, after stumbling across PowerShellGetv2 #516, and sure enough, I can run stuff as windows admin! without admin
With PS elevated:
|
@SydneyhSmith can we open this issue again? It is... blocking situation as far as it is core functionality |
Happy to re-open, it looks like it the past we fixed this is PowerShell and I don't expect a release of PackageManagement soon, so I need to do some debugging but may try to move it to another repo as well and make a bit of a fresh issue...trying to see if I can get a repro on it and do some debugging/read through old issues on this one
|
I may be able to prepare for you small .NET Core (.NET 7) WinForms powered app with powershell (core) inside with 3 rows of Powershell. It is small part of bigger applications installing IIS, url rewrite etc on WinServer 2016/2019 so we need to get nuget provider there |
@SydneyhSmith just to be sure... are you interested? |
@montella1507 yep |
Also experiencing this @SydneyhSmith |
Hi, I'm facing the same problem on PowerShell 7.3.6... |
This seems to still be an issue on 7.4.0.
|
Well I had the exact same problem and found that the correct path was missing to the powershell core modules folder. I added the path and shifted them in order as to first go to the core module path, then the users and lastly the v1.1 powershell modules folder. Rebooted the system and that worked for me. |
@jackvandeur Can you please share the details of your fix. Like your current core module path that works... Mine is like this and isn't working.
|
I am having packaging problems with powershell core, so I submitted PowerShell/PowerShell#10867. But @iSazonov re-directed me to oneget. I am completely lost as to what is wrong, but I thought I would let you know. Perhaps the most fundamental problem is with
get-packageprovider
:But when I run it, I get this error:
This seems to be a powershell core problem not a oneget problem. (I do not have these problems with powershell.)
The text was updated successfully, but these errors were encountered: