Skip to content

Update InstallModuleFromGitHub.psm1#20

Open
DBremen wants to merge 1 commit into
dfinke:masterfrom
DBremen:master
Open

Update InstallModuleFromGitHub.psm1#20
DBremen wants to merge 1 commit into
dfinke:masterfrom
DBremen:master

Conversation

@DBremen

@DBremen DBremen commented Jan 27, 2021

Copy link
Copy Markdown

Added type to ProjectUri Parameter
Fixed issue with $url based on ProjectUri containing extraneous slash character
Changed default value for $Branch parameter to 'main'

Added type to ProjectUri Parameter
Fixed issue with $url based on ProjectUri containing extraneous slash character
Changed default value for $Branch parameter to 'main'
Write-Verbose ("[$(Get-Date)] Retrieving {0} {1}" -f $GitHubRepo, $Branch)

$url = "https://api.github.com/repos/{0}/zipball/{1}" -f $GitHubRepo, $Branch
$url = "https://api.github.com/repos{0}/zipball/{1}" -f $GitHubRepo, $Branch

@jonaskuske jonaskuske Nov 27, 2022

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be clearer to keep this line as-is and apply the fix in line 17 instead:

                $GitHubRepo = $ProjectUri.AbsolutePath.Substring(1)

param(
$GitHubRepo,
$Branch = "master",
$Branch = 'main',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change – probably better to put this in a separate PR so the Uri fix below can be published without having to wait for a 2.x release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants