Skip to content
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

Install-ModuleFast: Fails to get plan for Plaster (for latest version 1.1.4) #48

Closed
johlju opened this issue Jan 3, 2024 · 3 comments · Fixed by #49
Closed

Install-ModuleFast: Fails to get plan for Plaster (for latest version 1.1.4) #48

johlju opened this issue Jan 3, 2024 · 3 comments · Fixed by #49
Assignees

Comments

@johlju
Copy link
Contributor

johlju commented Jan 3, 2024

$installModuleFastParameters = @{                             
    Destination          = './output/RequiredModules'
    NoPSModulePathUpdate = $true
    NoProfileUpdate      = $true
    Update               = $true
    Confirm              = $false
}

Install-ModuleFast -Specification 'Plaster' -Plan @installModuleFastParameters -Verbose -Debug

Result:

VERBOSE: Plaster: Evaluating Module Specification                                                                       
DEBUG: Plaster: Skipping PSModulePath /Users/johlju/source/Sampler/output/RequiredModules - Does not have this module.  
DEBUG: Plaster: Skipping 1.1.3 because -Update was specified and the version does not exactly meet the upper bound of the spec or no upper bound was specified at all, meaning there is a possible newer version remotely.
DEBUG: Plaster: New Best Candidate Version 1.1.3                                                                        
DEBUG: Plaster: Skipping 1.1.4 because -Update was specified and the version does not exactly meet the upper bound of the spec or no upper bound was specified at all, meaning there is a possible newer version remotely.
Install-ModuleFast: Could not compare "1.1.4" to "Plaster(1.1.3)". Error: "Cannot convert the "Plaster(1.1.3)" value of type "ModuleFastInfo" to type "NuGet.Versioning.NuGetVersion"."

Note

Using v0.1.0-rc1

@johlju johlju changed the title Install-ModuleFast: Fails to get plan for Plaster Install-ModuleFast: Fails to get plan for Plaster (for latest version 1.1.4) Jan 3, 2024
@johlju
Copy link
Contributor Author

johlju commented Jan 3, 2024

This happened when v1.1.3 and v1.1.4 was installed in a PSModulePath.

PS> get-module plaster -ListAvailable                 

    Directory: /Users/johlju/.local/share/powershell/Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.1.4                 Plaster                             Desk      {Invoke-Plaster, New-PlasterManifest, Get-PlasterTemplate, Test-PlasterManifest}
Script     1.1.3                 Plaster                             Desk      {Invoke-Plaster, New-PlasterManifest, Get-PlasterTemplate, Test-PlasterManifest}

    Directory: /Users/johlju/.vscode/extensions/ms-vscode.powershell-2023.8.0/modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.1.3                 Plaster                             Desk      {Invoke-Plaster, New-PlasterManifest, Get-PlasterTemplate, Test-PlasterManifest}

When I removed the versions already installed in /Users/johlju/.local/share/powershell/Modules it correctly resolved:

 VERBOSE: Plaster: Evaluating Module Specification                                                                       
DEBUG: Plaster: Skipping PSModulePath /Users/johlju/source/Sampler/output/RequiredModules - Does not have this module.  
DEBUG: Plaster: Skipping PSModulePath /Users/johlju/.local/share/powershell/Modules - Does not have this module.        
DEBUG: Plaster: Skipping PSModulePath /usr/local/share/powershell/Modules - Does not have this module.                  
DEBUG: Plaster: Skipping PSModulePath /usr/local/microsoft/powershell/7/Modules - Does not have this module.            
DEBUG: Plaster: Skipping 1.1.3 because -Update was specified and the version does not exactly meet the upper bound of the spec or no upper bound was specified at all, meaning there is a possible newer version remotely.
DEBUG: Plaster: New Best Candidate Version 1.1.3                                                                        
DEBUG: Plaster: 🔍 No installed versions matched the spec. Will check remotely.                                         
DEBUG: REQUEST CACHE HIT for Registration Index https://pwsh.gallery/index.json                                         
DEBUG: REQUEST CACHE HIT for https://pwsh.gallery/plaster/index.json                                                    
DEBUG: Plaster: Processing Response                                                                                     
DEBUG: Plaster: Received Response with 2 pages                                                                          
DEBUG: Plaster: Found satisfying version 1.1.4 in the inlined index.                                                    
VERBOSE: Plaster(1.1.4): Added to install plan                                                                          
VERBOSE: 📑 -Plan was specified. Returning a plan including 1 Module Specifications                                     
                                                                                                                        
Name    ModuleVersion Location                                                                                          
----    ------------- --------                                                                                          
Plaster 1.1.4         https://www.powershellgallery.com/api/v2/package/Plaster/1.1.4 

@johlju
Copy link
Contributor Author

johlju commented Jan 3, 2024

The same issue with PSScriptAnalyzer:

PS> get-module PSScriptAnalyzer -ListAvailable        

    Directory: /Users/johlju/.local/share/powershell/Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.19.1                PSScriptAnalyzer                    Desk      {Get-ScriptAnalyzerRule, Invoke-ScriptAnalyzer, Invoke-Formatter}
Script     1.18.3                PSScriptAnalyzer                    Desk      {Get-ScriptAnalyzerRule, Invoke-ScriptAnalyzer, Invoke-Formatter}

    Directory: /Users/johlju/.vscode/extensions/ms-vscode.powershell-2023.8.0/modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.21.0                PSScriptAnalyzer                    Desk      {Get-ScriptAnalyzerRule, Invoke-ScriptAnalyzer, Invoke-Formatter}

PS>                 $installModuleFastParameters = @{                                                 
>>                     Destination          = './output/RequiredModules'
>>                     NoPSModulePathUpdate = $true
>>                     NoProfileUpdate      = $true
>>                     Update               = $true
>>                     Confirm              = $false
>>                 }
PS> Install-ModuleFast -Specification 'PSScriptAnalyzer' -Plan @installModuleFastParameters -Verbose -Debug
VERBOSE: PSScriptAnalyzer: Evaluating Module Specification                                                              
DEBUG: PSScriptAnalyzer: Skipping PSModulePath /Users/johlju/source/Sampler/output/RequiredModules - Does not have this module.
DEBUG: PSScriptAnalyzer: Skipping 1.19.1 because -Update was specified and the version does not exactly meet the upper bound of the spec or no upper bound was specified at all, meaning there is a possible newer version remotely.
DEBUG: PSScriptAnalyzer: New Best Candidate Version 1.19.1                                                              
DEBUG: PSScriptAnalyzer: Skipping 1.18.3 because -Update was specified and the version does not exactly meet the upper bound of the spec or no upper bound was specified at all, meaning there is a possible newer version remotely.
Install-ModuleFast: Could not compare "1.18.3" to "PSScriptAnalyzer(1.19.1)". Error: "Cannot convert the "PSScriptAnalyzer(1.19.1)" value of type "ModuleFastInfo" to type "NuGet.Versioning.NuGetVersion"."

@JustinGrote
Copy link
Owner

Good catch! I'll take a look.

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

Successfully merging a pull request may close this issue.

2 participants