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

Exctracting module files into the wrong module version folder #58

Closed johlju closed 6 months ago

johlju commented 6 months ago

Found this problem when running SqlServerDsc's build pipeline. The module version of xDSCResourceDesigner is 1.13.0.0, but ModuleFast are extracting the files into the module version folder 1.13.0 so the installed module is never found e.g. using Get-Module -Name xDSCResourceDesigner -ListAvailable. Changing the module version folder to 1.13.0.0 (same as module manifest version) the module is found and can be used.

PS> Install-ModuleFast -Specification 'xDSCResourceDesigner' -Destination './output/RequiredModules' -NoProfileUpdate -NoPSModulePathUpdate -Update -Verbose -Debug -Confirm:$false         
DEBUG: Flushing ModuleFast Request Cache
VERBOSE: xDSCResourceDesigner: Evaluating Module Specification                                                          
DEBUG: xDSCResourceDesigner: Skipping PSModulePath /Users/johlju/source/SqlServerDsc/output/builtModule - Configured but does not exist.
DEBUG: xDSCResourceDesigner: Skipping PSModulePath /Users/johlju/source/SqlServerDsc/output/RequiredModules - Does not have this module.
DEBUG: xDSCResourceDesigner: Skipping PSModulePath /Users/johlju/.local/share/powershell/Modules - Does not have this module.
DEBUG: xDSCResourceDesigner: Skipping PSModulePath /usr/local/share/powershell/Modules - Does not have this module.     
DEBUG: xDSCResourceDesigner: Skipping PSModulePath /usr/local/microsoft/powershell/7/Modules - Does not have this module.
DEBUG: xDSCResourceDesigner: 🔍 No installed versions matched the spec. Will check remotely.                            
DEBUG: xDSCResourceDesigner: fetch registration index from https://pwsh.gallery/index.json                              
DEBUG: xDSCResourceDesigner: fetch info from https://pwsh.gallery/xdscresourcedesigner/index.json                       
DEBUG: xDSCResourceDesigner: Processing Response                                                                        
DEBUG: xDSCResourceDesigner: Received Response with 2 pages                                                             
DEBUG: xDSCResourceDesigner: Found satisfying version 1.13.0.0 in the inlined index.                                    
VERBOSE: xDSCResourceDesigner(1.13.0.0): Added to install plan                                                          
VERBOSE: Performing the operation "Install 1 Modules" on target "/Users/johlju/source/SqlServerDsc/output/RequiredModules".
VERBOSE: xDSCResourceDesigner(1.13.0.0): Downloading from https://www.powershellgallery.com/api/v2/package/xDSCResourceDesigner/1.13.0
VERBOSE: xDSCResourceDesigner(1.13.0.0): Extracting to /Users/johlju/source/SqlServerDsc/output/RequiredModules/xDSCResourceDesigner/1.13.0
VERBOSE: xDSCResourceDesigner(1.13.0.0): Installed to /Users/johlju/source/SqlServerDsc/output/RequiredModules/xDSCResourceDesigner/1.13.0
VERBOSE: ✅ All required modules installed! Exiting. 
JustinGrote commented 6 months ago

sigh I thought I fixed this and had a test for it, maybe something regressed with the switchover to NuGetVersion. Will look into it, thanks!

JustinGrote commented 6 months ago

OK so this is a unique case because of the repeating zeroes, the listing in pwshgallery is even wrong :). I should be able to fix this. image

JustinGrote commented 6 months ago

@johlju fixed in main, give & ([scriptblock]::Create((iwr 'bit.ly/modulefastmain'))) -UseMain a try

johlju commented 6 months ago

Yes it works perfectly now using main branch.