JustinGrote / ModuleFast

A "fast and loose" way to install modules from Powershell Gallery quickly. Meant for CICD, not production
Other
74 stars 5 forks source link

Using parameter `DestinationOnly` fails on module dependencies (?) #52

Closed johlju closed 7 months ago

johlju commented 7 months ago

When trying to get a plan for the the module Sampler.GitHubTasks it fails. Probably because it has a dependency of the module PowerShellForGitHub. It works with some other modules that do not have a dependency.

PS>  $installModuleFastParameters = @{                                                 
    Destination = './output/RequiredModules'                                                
    DestinationOnly = $true
    NoPSModulePathUpdate = $true
    NoProfileUpdate = $true
    Update = $true
    Confirm = $false
}
PS> Install-ModuleFast -Specification 'Sampler.GitHubTasks' -Plan @installModuleFastParameters -Verbose -Debug
DEBUG: Flushing ModuleFast Request Cache
VERBOSE: Sampler.GitHubTasks: Evaluating Module Specification                                                           
DEBUG: Sampler.GitHubTasks: Skipping PSModulePath /Users/johlju/source/Sampler/output/RequiredModules - 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.                                        
VERBOSE: Sampler.GitHubTasks(0.3.4): Added to install plan                                                              
DEBUG: Sampler.GitHubTasks: has 1 additional dependencies: PowerShellForGitHub                                          
DEBUG: No modules with name PowerShellForGitHub currently exist in the install plan. Resolving dependency...            
DEBUG: Fetching info on remaining 1 dependencies                                                                        
Install-ModuleFast: A parameter cannot be found that matches parameter name 'Destination'.  
JustinGrote commented 7 months ago

Currently the dependency logic and the main logic are somewhat redundant (I plan to unify them) so I probably missed updating something here, let me verify, thanks!