PowerShellGetv2
PowerShellGetv2 copied to clipboard
Cannot update packages on v7.1.3
Steps to reproduce
Update-Module
Expected behavior
Modules are updated.
Actual behavior
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'.
Install-Package: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:13069
Line |
13069 | … $sid = PackageManagement\Install-Package @PSBoundParameters
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| No match was found for the specified search criteria and module name 'posh-git'. Try Get-PSRepository to see all available registered module repositories.
Environment data
Name Value
---- -----
PSVersion 7.1.3
PSEdition Core
GitCommitId 7.1.3
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Comments
The command works properly on v7.2.0-preview.4, seems not a network issue.
Thanks @KexyBiscuit could you please try running this with the -Verbose and -Debug switches it would also be great if you could open a cmd prompt and run nuget help and dotnet --version specifically we are looking for your nuget and dotnet version
@SydneyhSmith Uninstall Az packages resolve the problem, I'll install them again to see if I can reproduce this.
@SydneyhSmith
C:\Users\KexyBiscuit> PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force -Verbose -Debug
DEBUG: 00:00:00.0000005 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0000431 Verbose: True
DEBUG: 00:00:00.0000507 Debug: True
DEBUG: 00:00:00.0000562 Force: True
DEBUG: 00:00:00.0000635 Name: posh-git
DEBUG: 00:00:00.0013000 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0021118 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0058084 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0091315 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0091717 Verbose: True
DEBUG: 00:00:00.0091803 Debug: True
DEBUG: 00:00:00.0091858 Force: True
DEBUG: 00:00:00.0091926 Name: posh-git
DEBUG: 00:00:00.0101289 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0108301 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0122569 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0167834 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0168121 Verbose: True
DEBUG: 00:00:00.0168191 Debug: True
DEBUG: 00:00:00.0168245 Force: True
DEBUG: 00:00:00.0168310 Name: posh-git
DEBUG: 00:00:00.0175761 INVOKING PowerShell Fn Get-DynamicOptions with args Package that has length 1
DEBUG: 00:00:00.0180991 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0200882 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0244598 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0244866 Verbose: True
DEBUG: 00:00:00.0244931 Debug: True
DEBUG: 00:00:00.0244985 Force: True
DEBUG: 00:00:00.0245053 Name: posh-git
DEBUG: 00:00:00.0254141 INVOKING PowerShell Fn Get-DynamicOptions with args Install that has length 1
DEBUG: 00:00:00.0262378 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0281212 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0418049 Calling SearchForPackages. Name='posh-git'
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
DEBUG: 00:00:00.0430570 PackageProvider::FindPackage with name posh-git
DEBUG: 00:00:00.0437079 Calling SearchForPackages After Select 1
DEBUG: 00:00:00.0463393 Calling New() : MethodName = 'FindPackage'
DEBUG: 00:00:00.0471752 Type: Module
DEBUG: 00:00:00.0482322 Verbose: True
DEBUG: 00:00:00.0488414 Debug: True
DEBUG: 00:00:00.0493931 Scope: CurrentUser
DEBUG: 00:00:00.0499182 Name: posh-git
DEBUG: 00:00:00.0505205 ProviderName: PowerShellGet
DEBUG: 00:00:00.0510562 Force: True
DEBUG: 00:00:00.0515813 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0525599 INVOKING PowerShell Fn Find-Package with args System.String[], , , that has length 4
DEBUG: 00:00:00.0536513 In PowerShellGet Provider - 'Find-Package'.
DEBUG: 00:00:00.0543732 OPTION: Type => Module
DEBUG: 00:00:00.0549088 OPTION: Verbose => True
DEBUG: 00:00:00.0554652 OPTION: Debug => True
DEBUG: 00:00:00.0560278 OPTION: Scope => CurrentUser
DEBUG: 00:00:00.0565839 OPTION: Name => posh-git
DEBUG: 00:00:00.0571561 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:00.0576866 OPTION: Force => True
DEBUG: 00:00:00.0582346 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
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'.
DEBUG: 00:00:00.0626571 PackageProvider::FindPackage with name posh-git
DEBUG: 00:00:00.0667399 Calling 'NuGet'::'FindPackage' - name='posh-git', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:00.0675406 Iterating 'posh-git'.
DEBUG: 00:00:00.0684729 There are '1' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.0692329 Source 'https://www.powershellgallery.com/api/v2' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:00.0698368 Source 'https://www.powershellgallery.com/api/v2' is validated.
DEBUG: 00:00:00.0705765 Calling 'NuGetRequest'::'GetPackageById', 'posh-git'.
DEBUG: 00:00:00.0713340 Calling 'NuGetPackageRepository'::'FindPackagesById', 'posh-git'.
DEBUG: 00:00:00.0720173 Calling 'NuGetPackageFeed2'::'FindPackage', 'posh-git'.
DEBUG: 00:00:00.0727109 Calling 'NuGetClient'::'FindPackage'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'' for ''.
DEBUG: 00:00:00.0741075 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'&$skip=0&$top=40'.
DEBUG: 00:00:01.2294617 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'&$skip=0&$top=40'.
DEBUG: 00:00:01.2324336 '14' packages received in the last request.
DEBUG: 00:00:01.2344364 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'&$skip=0&$top=40'.
DEBUG: 00:00:01.5374214 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'&$skip=0&$top=40'.
DEBUG: 00:00:01.5397834 '14' packages received in the last request.
VERBOSE: Total package yield:'1' for the specified package 'posh-git'.
DEBUG: 00:00:01.5524834 Completed iterating for 'posh-git'.
DEBUG: 00:00:01.5775020 Done calling powershell «Find-Package» «PSModule»
DEBUG: 00:00:01.5849867 Calling New() : MethodName = 'GetInstalledPackages'
DEBUG: 00:00:01.5854556 Type: Module
DEBUG: 00:00:01.5856886 Verbose: True
DEBUG: 00:00:01.5858936 Debug: True
DEBUG: 00:00:01.5861030 Scope: CurrentUser
DEBUG: 00:00:01.5863117 Name: posh-git
DEBUG: 00:00:01.5865363 ProviderName: PowerShellGet
DEBUG: 00:00:01.5867455 Force: True
DEBUG: 00:00:01.5869482 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:01.5878687 INVOKING PowerShell Fn Get-InstalledPackage with args posh-git, 1.0.0, , that has length 4
DEBUG: 00:00:01.5885801 In PowerShellGet Provider - 'Get-InstalledPackage'.
DEBUG: 00:00:01.5888977 OPTION: Type => Module
DEBUG: 00:00:01.5891486 OPTION: Verbose => True
DEBUG: 00:00:01.5893926 OPTION: Debug => True
DEBUG: 00:00:01.5897234 OPTION: Scope => CurrentUser
DEBUG: 00:00:01.5899731 OPTION: Name => posh-git
DEBUG: 00:00:01.5902534 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:01.5905002 OPTION: Force => True
DEBUG: 00:00:01.5907423 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:01.6895354 PowerShell Script 'PSModule' Function 'Get-InstalledPackage' returns null.
DEBUG: 00:00:01.6909946 Done calling powershell «Get-InstalledPackage» «PSModule»
Confirm
Are you sure you want to perform this action?
Performing the operation "Install-Module" on target "Version '1.0.0' of module 'posh-git'".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): a
DEBUG: 00:00:02.8703229 Calling New() : MethodName = 'InstallPackage'
DEBUG: 00:00:02.8708577 Type: Module
DEBUG: 00:00:02.8712455 Verbose: True
DEBUG: 00:00:02.8717261 Debug: True
DEBUG: 00:00:02.8723936 Scope: CurrentUser
DEBUG: 00:00:02.8728383 Name: posh-git
DEBUG: 00:00:02.8732574 ProviderName: PowerShellGet
DEBUG: 00:00:02.8736493 Force: True
DEBUG: 00:00:02.8740315 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:02.8747707 INVOKING PowerShell Fn Install-Package with args NuGet|posh-git|1.0.0|https://www.powershellgallery.com/api/v2|Module that has length 1
DEBUG: 00:00:02.8757270 In PowerShellGet Provider - 'Install-Package'.
DEBUG: 00:00:02.8777018 In PowerShellGet Provider - 'Install-PackageUtility'. DEBUG: 00:00:02.8782573 The FastPackageReference is 'NuGet|posh-git|1.0.0|https://www.powershellgallery.com/api/v2|Module'. DEBUG: 00:00:02.8789774 OPTION: Type => Module DEBUG: 00:00:02.8794570 OPTION: Verbose => True DEBUG: 00:00:02.8798742 OPTION: Debug => True DEBUG: 00:00:02.8802535 OPTION: Scope => CurrentUser DEBUG: 00:00:02.8806487 OPTION: Name => posh-git DEBUG: 00:00:02.8811046 OPTION: ProviderName => PowerShellGet DEBUG: 00:00:02.8814973 OPTION: Force => True DEBUG: 00:00:02.8818882 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString VERBOSE: The installation scope is specified to be 'CurrentUser'. VERBOSE: The specified module will be installed in 'C:\Users\KexyBiscuit\OneDrive\Documents\PowerShell\Modules'. DEBUG: 00:00:02.8831412 ArtifactType is Module VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'. VERBOSE: Downloading module 'posh-git' with version '1.0.0' from the repository 'https://www.powershellgallery.com/api/v2'. DEBUG: 00:00:02.9039695 Calling 'NuGet'::'InstallPackage', '$aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mg==\cG9zaC1naXQ=\MS4wLjA=\aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mg==\cG93ZXJzaGVsbGdldA=='.
DEBUG: 00:00:02.9051254 Calling 'NuGetRequest'::'GetPackageByFastpath', '$aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mg==\cG9zaC1naXQ=\MS4wLjA=\aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mg==\cG93ZXJzaGVsbGdldA=='.
DEBUG: 00:00:02.9058062 Calling 'NuGetRequest'::'ResolvePackageSource', 'https://www.powershellgallery.com/api/v2'.
DEBUG: 00:00:02.9063504 Calling 'NuGetRequest'::'FindRegisteredSource', 'https://www.powershellgallery.com/api/v2'.
DEBUG: 00:00:02.9068949 Source 'https://www.powershellgallery.com/api/v2' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:04.0947744 Calling 'NuGetPackageRepository'::'FindPackage', 'posh-git'.
DEBUG: 00:00:04.0966185 Calling 'NuGetPackageFeed2'::'FindPackage', 'posh-git'.
DEBUG: 00:00:04.0971216 Calling 'NuGetClient'::'FindPackage'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'' for ''.
DEBUG: 00:00:04.0981050 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'&$skip=0&$top=40'.
DEBUG: 00:00:05.3243847 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='posh-git'&$skip=0&$top=40'.
DEBUG: 00:00:05.3266372 '14' packages received in the last request.
DEBUG: 00:00:05.3272871 'Package version' is '1.0.0'.
DEBUG: 00:00:05.3283999 'Request's Destination' is 'C:\Users\KexyBiscuit\AppData\Local\Temp\125673643'.
DEBUG: 00:00:05.3287806 Calling 'NuGetPackageRepository'::'InstallPackage'.
DEBUG: 00:00:05.3290887 Calling 'NuGetFilesFeed2'::'InstallPackage'.
DEBUG: 00:00:05.3297213 Calling 'NuGetFilesFeed2'::'InstallPackage', '$aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mg==\cG9zaC1naXQ=\MS4wLjA=\aHR0cHM6Ly93d3cucG93ZXJzaGVsbGdhbGxlcnkuY29tL2FwaS92Mg==\cG93ZXJzaGVsbGdldA=='.
DEBUG: 00:00:05.3301379 Calling 'NuGetClient'::'GetPackageDependencies'.
DEBUG: 00:00:05.3305103 Returning the call 'NuGetClient'::'GetPackageDependencies'.
DEBUG: 00:00:05.3338376 Calling 'NuGetClient'::'InstallPackage'.
VERBOSE: InstallPackage' - name='posh-git', version='1.0.0',destination='C:\Users\KexyBiscuit\AppData\Local\Temp\125673643'
VERBOSE: DownloadPackage' - name='posh-git', version='1.0.0',destination='C:\Users\KexyBiscuit\AppData\Local\Temp\125673643\posh-git.1.0.0\posh-git.1.0.0.nupkg', uri='https://www.powershellgallery.com/api/v2/package/posh-git/1.0.0'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/posh-git/1.0.0'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/posh-git/1.0.0'.
VERBOSE: Completed downloading 'posh-git'.
DEBUG: 00:00:07.7942860 Calling 'NuGetClient'::'InstallPackageLocal'.
VERBOSE: InstallPackageLocal' - name='posh-git', version='1.0.0',destination='C:\Users\KexyBiscuit\AppData\Local\Temp\125673643'
DEBUG: 00:00:07.7962535 C:\Users\KexyBiscuit\AppData\Local\Temp\125673643\posh-git.1.0.0\posh-git.1.0.0.nupkg
DEBUG: 00:00:07.8774447 Returning the call 'NuGetClient'::'InstallPackageLocal'.
DEBUG: 00:00:07.8825468 Returning the call 'NuGetClient'::'InstallSinglePackage'.
DEBUG: 00:00:07.8832885 Returning the call 'NuGetFilesFeed2'::'InstallPackage'.
VERBOSE: Validating the 'posh-git' module contents under 'C:\Users\KexyBiscuit\AppData\Local\Temp\125673643\posh-git.1.0.0' path.
VERBOSE: Test-ModuleManifest successfully validated the module manifest file 'C:\Users\KexyBiscuit\AppData\Local\Temp\125673643\posh-git.1.0.0'.
VERBOSE: Validating the authenticode signature and publisher of the catalog file or module manifest file of the module 'posh-git'.
DEBUG: 00:00:08.0214428 Catalog file 'posh-git.cat' is not found in the contents of the previously-installed module 'posh-git' with the same name.
DEBUG: 00:00:08.0227774 Using the previously-installed module 'posh-git' with version '1.0.0' under 'C:\Users\KexyBiscuit\OneDrive\Documents\PowerShell\Modules\posh-git\1.0.0' for getting the publisher details.
DEBUG: 00:00:08.0240009 Using the 'C:\Users\KexyBiscuit\OneDrive\Documents\PowerShell\Modules\posh-git\1.0.0\posh-git.psd1' file for getting the authenticode signature.
DEBUG: 00:00:08.0321521 For publisher validation, using the previously-installed module 'posh-git' with version '1.0.0' under 'C:\Users\KexyBiscuit\OneDrive\Documents\PowerShell\Modules\posh-git\1.0.0' with publisher name '' from root certificate authority ''. Is this module signed by Microsoft: 'False'.
VERBOSE: Catalog file 'posh-git.cat' is not found in the contents of the module 'posh-git' being installed.
DEBUG: 00:00:08.0338802 Using the 'posh-git.psd1' file for getting the authenticode signature.
DEBUG: 00:00:08.0375854 For publisher validation, current module 'posh-git' with version '1.0.0' with publisher name '' from root certificate authority ''. Is this module signed by Microsoft: 'False'.
VERBOSE: For publisher validation, current module 'posh-git' with version '1.0.0' with publisher name '' from root certificate authority ''. Is this module signed by Microsoft: 'False'.
VERBOSE: For publisher validation, using the previously-installed module 'posh-git' with version '1.0.0' under 'C:\Users\KexyBiscuit\OneDrive\Documents\PowerShell\Modules\posh-git\1.0.0' with publisher name '' from root certificate authority ''. Is this module signed by Microsoft: 'False'.
DEBUG: 00:00:08.0403574 Previously-installed module publisher:
DEBUG: 00:00:08.0411646 Current module publisher:
DEBUG: 00:00:08.0452068 Is previously-installed module signed by Microsoft: False
DEBUG: 00:00:08.0461986 Is current module signed by Microsoft: False
VERBOSE: Checking for possible command collisions for the module 'posh-git' commands.
DEBUG: 00:00:08.0975738 PowerShell Script 'PSModule' Function 'Install-Package' returns null.
Install-Package: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9711
Line |
9711 | … talledPackages = PackageManagement\Install-Package @PSBoundParameters
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Administrator rights are required to install or update. Log on to the computer with an account that has Administrator rights, and then try
| again, or install by adding "-Scope CurrentUser" to your command. You can also try running the Windows PowerShell session with elevated
| rights (Run as Administrator).
C:\Users\KexyBiscuit> nuget help
nuget: The term 'nuget' 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.
C:\Users\KexyBiscuit> dotnet --version
5.0.201
I figured out how to reproduce this: use OneDrive's Auto Save (now called "Important PC Folders backup") to synchronize Documents folder, so that PowerShell modules and scripts are synchronized too. If modules were installed on other PCs, synchronized to this PC, then try to update or install them, this problem will occur. The workaround is to remove all modules and then reinstall them.
@KexyBiscuit sorry for this issue and odd workaround, this should be resolved in V3. We plan to do a release in a few weeks and would love if you can test this functionality then if you're interested.
@anamnavi Surely I am!
Same issue for me with PowerShell 7.1.4
We have just released this version of PowerShellGet, 3.0.11-beta, can you please try this version out and if you are encountering the same problem you can open up a new issue here so we can investigate and resolve it.
Has it been fixed for everybody?
Just did Install-Module -Name PowerShellGet -AllowPrerelease -Force and seeing 3.0.11-beta via Get-InstalledModule. I am still experiencing the issue using PowerShell 7.1.4.
Before creating a new issue in the "new repo", I'd like to know whether it is only me.
@timmkrause after doing Get-InstalledModule, what kind of cmdlets are you running? If after installing 3.0.11-beta and using cmdlets like Install-Module then you are still using the v2 cmdlets but instead using Install-PSResource then you are using the new v3 cmdlets.