File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,14 +254,18 @@ function Install-ModuleFast {
254254 )
255255 begin {
256256 trap {$PSCmdlet.ThrowTerminatingError ($PSItem )}
257-
258-
259-
260257 # Clear the ModuleFastCache if -Update is specified to ensure fresh lookups of remote module availability
261258 if ($Update ) {
262259 Clear-ModuleFastCache
263260 }
264261
262+ # Cleanup that allows for shorthand such as pwsh.gallery
263+ [Uri ]$srcTest = $Source
264+ if ($srcTest.Scheme -notin ' http' , ' https' ) {
265+ Write-Debug " Appending https and index.json to $Source "
266+ $Source = " https://$Source /index.json"
267+ }
268+
265269 $defaultRepoPath = $ (Join-Path ([Environment ]::GetFolderPath(' LocalApplicationData' )) ' powershell/Modules' )
266270 if (-not $Destination ) {
267271 # Special function that will retrieve the default module path for the current user
@@ -279,6 +283,8 @@ function Install-ModuleFast {
279283 throw ' Failed to determine destination path. This is a bug, please report it, it should always have something by this point.'
280284 }
281285
286+
287+
282288 # Require approval to create the destination folder if it is not our default path, otherwise this is automatic
283289 if (-not (Test-Path $Destination )) {
284290 if ($configRepoPath -or
You can’t perform that action at this time.
0 commit comments