Closed christianacca closed 6 years ago
Note: I did NOT include this commit in PR https://github.com/RamblingCookieMonster/PSDepend/pull/52 to make it possible to accept/reject each independently.
PR https://github.com/RamblingCookieMonster/PSDepend/pull/52:
import-module
This PR on the other hand does make a subtle change to the API contract - it changes the error message that will be thrown when the repository supplied cannot be found:
Before
[$Repository] has not been setup as a valid PowerShell repository.
After
Unable to find repository '[$Repository]'. Use Get-PSRepository to see all available repositories
Awesome, makes sense to me, thanks!
The existing PS commands that accept a repo (eg Install-Module) will already throw a message saying that the repo supplied cannot be found.
Calling
Get-PSRepository
for each PS repository takes approx. 3 seconds.So given a requirement.psd1 file with 2 repositories, 6s will be spent validating the repo exists. This time is a waste PS already is checking for this condition.