From 04a0dcb89d083250f0d5bb00c10a11508c1110c8 Mon Sep 17 00:00:00 2001 From: Howard Wolosky Date: Tue, 24 Sep 2019 10:58:02 -0700 Subject: [PATCH] Fix Update-GitHubRepository to properly handle the -Archived switch Due to a copy-paste error, the function was incorrectly inverting the user's choice. A separate work item will be created to track adding some additional tests to this part of the code. Fixes #134 --- GitHubRepositories.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GitHubRepositories.ps1 b/GitHubRepositories.ps1 index 0bef7b1b..2b9f1071 100644 --- a/GitHubRepositories.ps1 +++ b/GitHubRepositories.ps1 @@ -522,7 +522,7 @@ function Update-GitHubRepository By default, rebase-merge pull requests will be allowed. Specify this to disallow. - .PARAMETER DisallowRebaseMerge + .PARAMETER Archived Specify this to archive this repository. NOTE: You cannot unarchive repositories through the API / this module. @@ -610,7 +610,7 @@ function Update-GitHubRepository if ($PSBoundParameters.ContainsKey('DisallowSquashMerge')) { $hashBody['allow_squash_merge'] = (-not $DisallowSquashMerge.ToBool()) } if ($PSBoundParameters.ContainsKey('DisallowMergeCommit')) { $hashBody['allow_merge_commit'] = (-not $DisallowMergeCommit.ToBool()) } if ($PSBoundParameters.ContainsKey('DisallowRebaseMerge')) { $hashBody['allow_rebase_merge'] = (-not $DisallowRebaseMerge.ToBool()) } - if ($PSBoundParameters.ContainsKey('Archived')) { $hashBody['archived'] = (-not $Archived.ToBool()) } + if ($PSBoundParameters.ContainsKey('Archived')) { $hashBody['archived'] = $Archived.ToBool() } $params = @{ 'UriFragment' = "repos/$OwnerName/$ReposistoryName"