Open johlju opened 2 years ago
At this line the module PowerShellGet is imported to verify version. https://github.com/gaelcolas/Sampler/blob/d19ef072498ac9df81a3839b0b7a502a066f2235/Resolve-Dependency.ps1#L233
But we already imported it at line: https://github.com/gaelcolas/Sampler/blob/d19ef072498ac9df81a3839b0b7a502a066f2235/Resolve-Dependency.ps1#L171
We should be able to reuse the variable at line 171 (the first import) to evaluate module version here: https://github.com/gaelcolas/Sampler/blob/d19ef072498ac9df81a3839b0b7a502a066f2235/Resolve-Dependency.ps1#L238
As long as the -Force is not used, it's not a big issue as it effectively does nothing but return the module object. That said, if it's not need to run, then it's definitively interested in such PR.
At this line the module PowerShellGet is imported to verify version. https://github.com/gaelcolas/Sampler/blob/d19ef072498ac9df81a3839b0b7a502a066f2235/Resolve-Dependency.ps1#L233
But we already imported it at line: https://github.com/gaelcolas/Sampler/blob/d19ef072498ac9df81a3839b0b7a502a066f2235/Resolve-Dependency.ps1#L171
We should be able to reuse the variable at line 171 (the first import) to evaluate module version here: https://github.com/gaelcolas/Sampler/blob/d19ef072498ac9df81a3839b0b7a502a066f2235/Resolve-Dependency.ps1#L238