`Install-PSResource -Version` does not install the latest version of a module in given NuGet version range
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza en el punto de entrada de Install-PSResource y sigue las rutas V2ServerAPICalls::FindVersionGlobbing y InstallVersion que se muestran en la salida de depuración. Reproduce el comando con el rango '[2, 3)' e inspecciona cómo se seleccionan los resultados en orden descendente. Se considera terminado cuando el comando instala la versión 2.25.0, la versión más reciente del rango, en lugar de 2.9.1.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
According to the module doc, Install-PSResource command should install the latest version in given NuGet version range. However the command does not select the latest minor / patch version correctly. In below examples Install-PSResource installs version 2.9.1 although the latest version in given range is 2.25.0.
Here's the output of Find-PSResource that shows all the available versions of the example module at the time of writing.
PS> Find-PSResource Microsoft.Graph.Authentication -Repository PSGallery -Version '[2, 3)'
Name Version Prerelease Repository Description
---- ------- ---------- ---------- -----------
Microsoft.Graph.Authentication 2.9.1 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.9.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.8.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.6.1 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.5.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.4.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.3.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.25.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.24.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.23.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.22.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.21.1 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.21.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.20.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.2.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.19.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.18.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.17.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.16.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.15.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.14.1 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.14.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.13.1 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.13.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.12.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.11.1 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.11.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.10.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.1.0 PSGallery Microsoft Graph PowerShell Authentication Module.
Microsoft.Graph.Authentication 2.0.0 PSGallery Microsoft Graph PowerShell Authentication Module.
PowerShell Gallery link: Microsoft.Graph.Authentication
Expected behavior
PS> Install-PSResource -Name Microsoft.Graph.Authentication -Version '[2, 3)' -Repository PSGallery -PassThru | Select Name, Version
Name Version
---- -------
Microsoft.Graph.Authentication 2.25.0
Actual behavior
PS> Install-PSResource -Name Microsoft.Graph.Authentication -Version '[2, 3)' -Repository PSGallery -PassThru | Select Name, Version
Name Version
---- -------
Microsoft.Graph.Authentication 2.9.1
Error details
Environment data
PS> Get-Module Microsoft.PowerShell.PSResourceGet; $PSVersionTable | Format-Table
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 1.1.0 Microsoft.PowerShell.PSResourceGet {Compress-PSResource, Find-PSResource, Get-Insta…
Name Value
---- -----
PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Darwin 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 18:56:34 PST 2024; root:xnu-112…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
It appears that Install-PSResource simply installs the first module returned by the PowerShell Gallery API which does not always match the latest version.
PS> Install-PSResource -Name Microsoft.Graph.Authentication -Version '[2, 3)' -Repository PSGallery -Debug
<REDACTED>
DEBUG: In InstallPSResource::ProcessInstallHelper()
DEBUG: In InstallHelper::BeginInstallPackages()
DEBUG: Parameters passed in >>> Name: 'Microsoft.Graph.Authentication'; VersionRange: '[2, 3)'; NuGetVersion: ''; VersionType: 'VersionRange'; Version: '[2, 3)'; Prerelease: 'False'; Repository: 'PSGallery'; AcceptLicense: 'False'; Quiet: 'False'; Reinstall: 'False'; TrustRepository: 'False'; NoClobber: 'False'; AsNupkg: 'False'; IncludeXml 'True'; SavePackage 'False'; TemporaryPath ''; SkipDependencyCheck: 'False'; AuthenticodeCheck: 'False'; PathsToInstallPkg: '/Users/rasmusb/.local/share/powershell/Modules,/Users/rasmusb/.local/share/powershell/Scripts'; Scope 'CurrentUser'
DEBUG: In InstallHelper::ProcessRepositories()
VERBOSE: Attempting to search for packages in 'PSGallery'
DEBUG: In InstallHelper::InstallPackages()
DEBUG: In InstallHelper::InstallPackage()
DEBUG: In V2ServerAPICalls::FindVersionGlobbing()
DEBUG: In V2ServerAPICalls::FindVersionGlobbing()
DEBUG: In V2ServerAPICalls::HttpRequestCall()
DEBUG: Request url is 'https://www.powershellgallery.com/api/v2/FindPackagesById()?$filter=NormalizedVersion+ge+%272.0.0%27+and+NormalizedVersion+lt+%273.0.0%27+and+IsPrerelease+eq+false+and+Id+eq+%27Microsoft.Graph.Authentication%27&$inlinecount=allpages&$skip=0&$orderby=NormalizedVersion+desc&id=%27Microsoft.Graph.Authentication%27'
DEBUG: In V2ServerAPICalls::InstallVersion()
DEBUG: In V2ServerAPICalls::HttpRequestCallForContent()
DEBUG: Request url is 'https://www.powershellgallery.com/api/v2/package/Microsoft.Graph.Authentication/2.9.1'
- Lenguaje dominante
- C#
- Estrellas
- 577
- Forks
- 114
- Merge medio
- 23 h 17 min
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PowerShell/PSResourceGet
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectoryAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PowerShell/PSResourceGet#2056 ·
Los mantenedores suelen responder en 1 día
-
feature_request
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
PowerShell/PSResourceGet#2013 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Use GitHub app token to authenticate to GitHub resourcesPosiblemente ocupada @adityapatwardhan la tomó hace 10 días. Abiertofeature_request Needs-Triage
PowerShell/PSResourceGet#2057 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Needs-Triage
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
PowerShell/PSResourceGet#2055 ·
Los mantenedores suelen responder en 1 día
-
Needs-Triage
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
PowerShell/PSResourceGet#2054 ·
Los mantenedores suelen responder en 1 día
Todos los issues de PowerShell/PSResourceGet
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
dotnet/command-line-api#2852 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
modelcontextprotocol/csharp-sdk#1899 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
ClickHouse/clickhouse-cs#639 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
ifpebj-ti/controle-acesso-veiculos#377 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día