From 0910f995cfbdb4f9a4dff514ba45354cbef3697e Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 27 Jan 2021 13:13:32 +0000 Subject: [PATCH] Update InstallModuleFromGitHub.psm1 Added type to ProjectUri Parameter Fixed issue with $url based on ProjectUri containing extraneous slash character Changed default value for $Branch parameter to 'main' --- InstallModuleFromGitHub.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/InstallModuleFromGitHub.psm1 b/InstallModuleFromGitHub.psm1 index cbe747b..66bdb68 100644 --- a/InstallModuleFromGitHub.psm1 +++ b/InstallModuleFromGitHub.psm1 @@ -2,9 +2,9 @@ function Install-ModuleFromGitHub { [CmdletBinding()] param( $GitHubRepo, - $Branch = "master", + $Branch = 'main', [Parameter(ValueFromPipelineByPropertyName)] - $ProjectUri, + [System.Uri]$ProjectUri, $DestinationPath, $SSOToken, $moduleName @@ -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 if ($moduleName) { $targetModuleName = $moduleName