Skip to content

Commit

Permalink
Fix Update-GitHubRepository to properly handle the -Archived switch (#…
Browse files Browse the repository at this point in the history
…135)

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
  • Loading branch information
HowardWolosky authored Sep 24, 2019
1 parent 013452b commit 9bdb37c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GitHubRepositories.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 9bdb37c

Please sign in to comment.