Skip to content

Commit 1017ba7

Browse files
HowardWoloskysmaglio81
authored andcommitted
Fix Update-GitHubRepository to properly handle the -Archived switch (microsoft#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 microsoft#134
1 parent d61b7f1 commit 1017ba7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

GitHubRepositories.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ function Update-GitHubRepository
522522
By default, rebase-merge pull requests will be allowed.
523523
Specify this to disallow.
524524
525-
.PARAMETER DisallowRebaseMerge
525+
.PARAMETER Archived
526526
Specify this to archive this repository.
527527
NOTE: You cannot unarchive repositories through the API / this module.
528528
@@ -610,7 +610,7 @@ function Update-GitHubRepository
610610
if ($PSBoundParameters.ContainsKey('DisallowSquashMerge')) { $hashBody['allow_squash_merge'] = (-not $DisallowSquashMerge.ToBool()) }
611611
if ($PSBoundParameters.ContainsKey('DisallowMergeCommit')) { $hashBody['allow_merge_commit'] = (-not $DisallowMergeCommit.ToBool()) }
612612
if ($PSBoundParameters.ContainsKey('DisallowRebaseMerge')) { $hashBody['allow_rebase_merge'] = (-not $DisallowRebaseMerge.ToBool()) }
613-
if ($PSBoundParameters.ContainsKey('Archived')) { $hashBody['archived'] = (-not $Archived.ToBool()) }
613+
if ($PSBoundParameters.ContainsKey('Archived')) { $hashBody['archived'] = $Archived.ToBool() }
614614

615615
$params = @{
616616
'UriFragment' = "repos/$OwnerName/$ReposistoryName"

0 commit comments

Comments
 (0)