Skip to content

Install-ModuleFast: Return wrong modules when using -WhatIf #35

@johlju

Description

@johlju

Here is a strange issue. It returns the wrong modules. It does not return Sampler.GitHubTask but it returns Sampler and Plaster. (Sampler is dependent on Plaster). All of these are installed, so non should be returned.

Problem:

PS> Install-ModuleFast -Specification 'Sampler','Sampler.GitHubtasks' -Destination './output/RequiredModules' -NoProfileUpdate -NoPSModulePathUpdate -Update -Verbose -Debug -Confirm:$false -WhatIf
VERBOSE: Sampler(): Evaluating Module Specification                                                                     
DEBUG: Sampler(): Skipping PSModulePath /Users/johlju/source/Sampler/output/builtModule - Configured but does not exist.
DEBUG: Sampler(): Skipping PSModulePath /Users/johlju/source/Sampler/output/RequiredModules - Does not have this module.
DEBUG: Sampler(): Skipping PSModulePath /Users/johlju/.local/share/powershell/Modules - Does not have this module.      
DEBUG: Sampler(): Skipping PSModulePath /usr/local/share/powershell/Modules - Does not have this module.                
DEBUG: Sampler(): Skipping PSModulePath /usr/local/microsoft/powershell/7/Modules - Does not have this module.          
DEBUG: Sampler(): 🔍 No installed versions matched the spec. Will check remotely.                                       
DEBUG: Sampler: fetch registration index from https://preview.pwsh.gallery/index.json                                   
DEBUG: Sampler: fetch info from https://preview.pwsh.gallery/sampler/index.json                                         
VERBOSE: Sampler.GitHubtasks(): Evaluating Module Specification                                                         
DEBUG: Sampler.GitHubtasks(): Skipping PSModulePath /Users/johlju/source/Sampler/output/builtModule - Configured but does not exist.
DEBUG: Sampler.GitHubtasks(): Skipping 0.3.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.
DEBUG: Sampler.GitHubtasks(): New Best Candidate Version 0.3.4                                                          
DEBUG: Sampler.GitHubtasks(): Skipping PSModulePath /Users/johlju/.local/share/powershell/Modules - Does not have this module.
DEBUG: Sampler.GitHubtasks(): Skipping PSModulePath /usr/local/share/powershell/Modules - Does not have this module.    
DEBUG: Sampler.GitHubtasks(): Skipping PSModulePath /usr/local/microsoft/powershell/7/Modules - Does not have this module.
DEBUG: Sampler.GitHubtasks(): 🔍 No installed versions matched the spec. Will check remotely.                           
DEBUG: Sampler.GitHubtasks: fetch registration index from https://preview.pwsh.gallery/index.json                       
DEBUG: Sampler.GitHubtasks: fetch info from https://preview.pwsh.gallery/sampler.githubtasks/index.json                 
DEBUG: Sampler.GitHubtasks(): Processing Response                                                                       
DEBUG: Sampler.GitHubtasks(): Received Response with 3 pages                                                            
DEBUG: Sampler.GitHubtasks(): skipping candidate 0.3.5-preview0002 because it is a prerelease and prerelease was not specified either with the -Prerelease parameter, by specifying a prerelease version in the spec, or adding a ! on the module name spec to indicate prerelease is acceptable.
DEBUG: Sampler.GitHubtasks(): Found satisfying version 0.3.4 in the inlined index.                                      
DEBUG: Sampler.GitHubTasks(0.3.4): ✅ -Update was specified and the best remote candidate matches what is locally installed, so we can skip this module.
DEBUG: Sampler(): Processing Response                                                                                   
DEBUG: Sampler(): Received Response with 4 pages                                                                        
DEBUG: Sampler.GitHubtasks(): Found satisfying version 0.117.0 in the inlined index.                                    
VERBOSE: Sampler(0.117.0): Added to install plan                                                                        
DEBUG: Sampler(): has 1 additional dependencies: Plaster()                                                              
DEBUG: No modules with name Plaster currently exist in the install plan. Resolving dependency...                        
DEBUG: Fetching info on remaining 1 dependencies                                                                        
DEBUG: Plaster(): Skipping PSModulePath /Users/johlju/source/Sampler/output/builtModule - Configured but does not exist.
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.
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(): 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.
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: No local modules that satisfies dependency Plaster(). Checking Remote...                                         
DEBUG: Sampler(): Fetching dependency Plaster()                                                                         
DEBUG: Plaster: fetch registration index from https://preview.pwsh.gallery/index.json                                   
DEBUG: Plaster: fetch info from https://preview.pwsh.gallery/plaster/index.json                                         
DEBUG: Plaster(): Processing Response                                                                                   
DEBUG: Plaster(): Received Response with 2 pages                                                                        
DEBUG: Sampler.GitHubtasks(): Found satisfying version 1.1.4 in the inlined index.                                      
VERBOSE: Plaster(1.1.4): Added to install plan                                                                          
What if: Performing the operation "Install 2 Modules" on target "/Users/johlju/source/Sampler/output/RequiredModules".  
                                                                                                                         
Name    ModuleVersion                                                                                                   
----    -------------                                                                                                   
Sampler 0.117.0                                                                                                         
Plaster 1.1.4    

PS> get-module -Name 'Sampler', 'Sampler.GitHubTasks', 'Plaster' -ListAvailable | ft Name,Version,Path  

Name                Version Path
----                ------- ----
Plaster             1.1.4   /Users/johlju/source/Sampler/output/RequiredModules/Plaster/1.1.4/Plaster.psd1
Sampler.GitHubTasks 0.3.4   /Users/johlju/source/Sampler/output/RequiredModules/Sampler.GitHubTasks/0.3.4/Sampler.GitHubTasks.ps…
Plaster             1.1.4   /Users/johlju/.local/share/powershell/Modules/Plaster/1.1.4/Plaster.psd1
Plaster             1.1.3   /Users/johlju/.local/share/powershell/Modules/Plaster/1.1.3/Plaster.psd1                                                                

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions