From b0f36f295ea7dd19b1b1940c374b840dfa27fb84 Mon Sep 17 00:00:00 2001 From: Simon Heather Date: Tue, 2 Jun 2020 19:16:38 +0100 Subject: [PATCH 1/2] Set-GitHubRepositoryTopic: Fix Clear Exception --- GitHubRepositories.ps1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/GitHubRepositories.ps1 b/GitHubRepositories.ps1 index 29228af7..71be8c67 100644 --- a/GitHubRepositories.ps1 +++ b/GitHubRepositories.ps1 @@ -1033,12 +1033,18 @@ function Set-GitHubRepositoryTopic 'Clear' = $PSBoundParameters.ContainsKey('Clear') } - $description = "Replacing topics in $RepositoryName" - if ($Clear) { $description = "Clearing topics in $RepositoryName" } + if ($Clear) + { + $description = "Clearing topics in $RepositoryName" + $Name=@() + } + else + { + $description = "Replacing topics in $RepositoryName" + } - $names = @($Name) $hashBody = @{ - 'names' = $names + 'names' = $Name } $params = @{ From 0517a3addb1ff4ef453695a091b3c2786eefc075 Mon Sep 17 00:00:00 2001 From: Simon Heather <32168619+X-Guardian@users.noreply.github.com> Date: Tue, 2 Jun 2020 20:56:00 +0100 Subject: [PATCH 2/2] Update GitHubRepositories.ps1 Co-authored-by: Howard Wolosky --- GitHubRepositories.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitHubRepositories.ps1 b/GitHubRepositories.ps1 index 71be8c67..842c75ea 100644 --- a/GitHubRepositories.ps1 +++ b/GitHubRepositories.ps1 @@ -1036,7 +1036,7 @@ function Set-GitHubRepositoryTopic if ($Clear) { $description = "Clearing topics in $RepositoryName" - $Name=@() + $Name = @() } else {