-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Labels
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
Steps to reproduce
ITNOA
Hi
I have PowerShell 7.5.4, when I run below command
Get-PSRepository
Name InstallationPolicy SourceLocation
---- ------------------ --------------
PSGallery Untrusted https://www.powershellgallery.com/api/v2as I know https://www.powershellgallery.com/api/v2 is deprecated, and if I try to install some package on PSGallery I got below error
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'.So I have to use v3 (based on Microsoft Community answer, so I use below command
Unregister-PSRepository -Name 'PSGallery'
Register-PSRepository -Default -SourceLocation 'https://www.powershellgallery.com/api/v3' -InstallationPolicy TrustedBut I got below error
Register-PSRepository: Use 'Register-PSRepository -Default' to register the PSGallery repository.But as I know, Register-PSRepository -Default does not register correct source location
So I do not know how to resolve this problem?
One strange thing is for example if I try to install Terminal-Icons with Install-Module I got below error
Install-Module -Name Terminal-Icons -Repository PSGallery
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'.
Install-Package: No match was found for the specified search criteria and module name 'Terminal-Icons'. Try Get-PSRepository to see all available registered module repositories.but I try to install above module with Install-PSResource everything work correctly as below
Install-PSResource -Name Terminal-Icons -Repository PSGalleryI ask similar question on https://stackoverflow.com/q/79879316/1539100
- I do not clear difference between *-Module (very good and clear commands) and *-PSResource (strange commands)
- I do not clear why PSResource create (recreate wheel) when OneGet exist and what is difference between them https://stackoverflow.com/a/77932395/1539100
Expected behavior
Install-Module work correctlyActual behavior
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'.
Install-Package: No match was found for the specified search criteria and module name 'Terminal-Icons'. Try Get-PSRepository to see all available registered module repositories.Error details
Exception :
Type : System.Exception
Message : No match was found for the specified search criteria and module name 'Terminal-Icons'. Try Get-PSRepository to see all available registered module repositories.
HResult : -2146233088
TargetObject : Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
CategoryInfo : ObjectNotFound: (Microsoft.PowerShel…lets.InstallPackage:InstallPackage) [Install-Package], Exception
FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
InvocationInfo :
MyCommand : Install-Package
ScriptLineNumber : 9711
OffsetInLine : 34
HistoryId : 139
ScriptName : C:\program files\windowsapps\microsoft.powershell_7.5.4.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet\PSModule.psm1
Line : $installedPackages = PackageManagement\Install-Package @PSBoundParameters
Statement : PackageManagement\Install-Package @PSBoundParameters
PositionMessage : At C:\program files\windowsapps\microsoft.powershell_7.5.4.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet\PSModule.psm1:9711 char:34
+ … talledPackages = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSScriptRoot : C:\program files\windowsapps\microsoft.powershell_7.5.4.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet
PSCommandPath : C:\program files\windowsapps\microsoft.powershell_7.5.4.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet\PSModule.psm1
InvocationName : PackageManagement\Install-Package
CommandOrigin : Internal
ScriptStackTrace : at Install-Module<Process>, C:\program files\windowsapps\microsoft.powershell_7.5.4.0_x64__8wekyb3d8bbwe\Modules\PowerShellGet\PSModule.psm1: line 9711
at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
0
1Environment data
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 1.1.1 Microsoft.PowerShell.PSResourceGet {Compress-PSResource, Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository…}
Name Value
---- -----
PSVersion 7.5.4
PSEdition Core
GitCommitId 7.5.4
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response