Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions InstallModuleFromGitHub.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ function Install-ModuleFromGitHub {
[CmdletBinding()]
param(
$GitHubRepo,
$Branch = "master",
$Branch = 'main',

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?

[Parameter(ValueFromPipelineByPropertyName)]
$ProjectUri,
[System.Uri]$ProjectUri,
$DestinationPath,
$SSOToken,
$moduleName
Expand All @@ -24,7 +24,7 @@ function Install-ModuleFromGitHub {
if($GitHubRepo) {
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
Copy link

@jonaskuske jonaskuske Nov 27, 2022

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)


if ($moduleName) {
$targetModuleName = $moduleName
Expand Down