File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -254,14 +254,18 @@ function Install-ModuleFast {
254
254
)
255
255
begin {
256
256
trap {$PSCmdlet.ThrowTerminatingError ($PSItem )}
257
-
258
-
259
-
260
257
# Clear the ModuleFastCache if -Update is specified to ensure fresh lookups of remote module availability
261
258
if ($Update ) {
262
259
Clear-ModuleFastCache
263
260
}
264
261
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
+
265
269
$defaultRepoPath = $ (Join-Path ([Environment ]::GetFolderPath(' LocalApplicationData' )) ' powershell/Modules' )
266
270
if (-not $Destination ) {
267
271
# Special function that will retrieve the default module path for the current user
@@ -279,6 +283,8 @@ function Install-ModuleFast {
279
283
throw ' Failed to determine destination path. This is a bug, please report it, it should always have something by this point.'
280
284
}
281
285
286
+
287
+
282
288
# Require approval to create the destination folder if it is not our default path, otherwise this is automatic
283
289
if (-not (Test-Path $Destination )) {
284
290
if ($configRepoPath -or
You can’t perform that action at this time.
0 commit comments