Importing PowerShellGet twice
- Dominant language
- PowerShell
- Stars
- 243
- Forks
- 46
- Avg merge
- 1h 41m
- Merged PRs (30d)
- 1
Description
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
Contributor guide
Research direction
Open Resolve-Dependency.ps1 and compare the PowerShellGet import at line 171 with the later import near line 233 and version check near line 238. Confirm how the first import's variable is used, then remove the duplicate import while preserving the version evaluation. Done when the dependency resolution path imports PowerShellGet only once.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100