From b52bdf23d475920058ab906f653edb4a36bf6f3f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Nov 2023 22:14:19 +0100 Subject: [PATCH] fix --- .../Repositories/New-GitHubRepository.ps1 | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/src/GitHub/public/Repositories/Repositories/New-GitHubRepository.ps1 b/src/GitHub/public/Repositories/Repositories/New-GitHubRepository.ps1 index a8b318b0..7d40568a 100644 --- a/src/GitHub/public/Repositories/Repositories/New-GitHubRepository.ps1 +++ b/src/GitHub/public/Repositories/Repositories/New-GitHubRepository.ps1 @@ -326,33 +326,35 @@ } Process { - $params = @{ - Owner = $Owner - Name = $Name - Description = $Description - Homepage = $Homepage - Visibility = $Visibility - HasIssues = $HasIssues - HasProjects = $HasProjects - HasWiki = $HasWiki - HasDiscussions = $HasDiscussions - HasDownloads = $HasDownloads - IsTemplate = $IsTemplate - TeamId = $TeamId - AutoInit = $AutoInit - AllowSquashMerge = $AllowSquashMerge - AllowMergeCommit = $AllowMergeCommit - AllowRebaseMerge = $AllowRebaseMerge - AllowAutoMerge = $AllowAutoMerge - DeleteBranchOnMerge = $DeleteBranchOnMerge - SquashMergeCommitTitle = $SquashMergeCommitTitle - SquashMergeCommitMessage = $SquashMergeCommitMessage - MergeCommitTitle = $MergeCommitTitle - MergeCommitMessage = $MergeCommitMessage - GitignoreTemplate = $GitignoreTemplate - LicenseTemplate = $LicenseTemplate + if ($PSCmdlet.ParameterSetName -in 'user', 'org') { + $params = @{ + Owner = $Owner + Name = $Name + Description = $Description + Homepage = $Homepage + Visibility = $Visibility + HasIssues = $HasIssues + HasProjects = $HasProjects + HasWiki = $HasWiki + HasDiscussions = $HasDiscussions + HasDownloads = $HasDownloads + IsTemplate = $IsTemplate + TeamId = $TeamId + AutoInit = $AutoInit + AllowSquashMerge = $AllowSquashMerge + AllowMergeCommit = $AllowMergeCommit + AllowRebaseMerge = $AllowRebaseMerge + AllowAutoMerge = $AllowAutoMerge + DeleteBranchOnMerge = $DeleteBranchOnMerge + SquashMergeCommitTitle = $SquashMergeCommitTitle + SquashMergeCommitMessage = $SquashMergeCommitMessage + MergeCommitTitle = $MergeCommitTitle + MergeCommitMessage = $MergeCommitMessage + GitignoreTemplate = $GitignoreTemplate + LicenseTemplate = $LicenseTemplate + } + Remove-HashtableEntry -Hashtable $params -NullOrEmptyValues } - Remove-HashtableEntry -Hashtable $params -NullOrEmptyValues switch ($PSCmdlet.ParameterSetName) { 'user' { @@ -385,7 +387,7 @@ $params = @{ ForkOwner = $ForkOwner ForkRepo = $ForkRepo - Owner = $Owner + Organization = $Owner Name = $Name DefaultBranchOnly = $DefaultBranchOnly }