Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions GitHubRepositories.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ filter New-GitHubRepository
.PARAMETER NoWiki
By default, this repository will have a Wiki. Specify this to disable the Wiki.

.PARAMETER Discussions
Comment thread
HowardWolosky marked this conversation as resolved.
Outdated
By default, this repository will not have Discussions. Specify this to enable Discussions.

.PARAMETER AutoInit
Specify this to create an initial commit with an empty README.

Expand Down Expand Up @@ -152,6 +155,8 @@ filter New-GitHubRepository

[switch] $NoWiki,

[switch] $Discussions,

[switch] $AutoInit,

[switch] $DisallowSquashMerge,
Expand Down Expand Up @@ -201,6 +206,7 @@ filter New-GitHubRepository
if ($PSBoundParameters.ContainsKey('NoIssues')) { $hashBody['has_issues'] = (-not $NoIssues.ToBool()) }
if ($PSBoundParameters.ContainsKey('NoProjects')) { $hashBody['has_projects'] = (-not $NoProjects.ToBool()) }
if ($PSBoundParameters.ContainsKey('NoWiki')) { $hashBody['has_wiki'] = (-not $NoWiki.ToBool()) }
if ($PSBoundParameters.ContainsKey('Discussions')) { $hashBody['has_discussions'] = ( $Discussions.ToBool()) }
if ($PSBoundParameters.ContainsKey('AutoInit')) { $hashBody['auto_init'] = $AutoInit.ToBool() }
if ($PSBoundParameters.ContainsKey('DisallowSquashMerge')) { $hashBody['allow_squash_merge'] = (-not $DisallowSquashMerge.ToBool()) }
if ($PSBoundParameters.ContainsKey('DisallowMergeCommit')) { $hashBody['allow_merge_commit'] = (-not $DisallowMergeCommit.ToBool()) }
Expand Down
5 changes: 5 additions & 0 deletions Tests/GitHubRepositories.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
$repo.has_issues | Should -BeTrue
$repo.has_projects | Should -BeTrue
$repo.has_Wiki | Should -BeTrue
$repo.has_discussions | Should -BeFalse
$repo.allow_squash_merge | Should -BeTrue
$repo.allow_merge_commit | Should -BeTrue
$repo.allow_rebase_merge | Should -BeTrue
Expand Down Expand Up @@ -88,6 +89,7 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
$repo.has_issues | Should -BeTrue
$repo.has_projects | Should -BeTrue
$repo.has_Wiki | Should -BeTrue
$repo.has_discussions | Should -BeFalse
$repo.allow_squash_merge | Should -BeTrue
$repo.allow_merge_commit | Should -BeTrue
$repo.allow_rebase_merge | Should -BeTrue
Expand Down Expand Up @@ -116,6 +118,7 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
NoIssues = $true
NoProjects = $true
NoWiki = $true
Discussions = $true
DisallowSquashMerge = $true
DisallowMergeCommit = $true
DisallowRebaseMerge = $false
Expand All @@ -139,6 +142,7 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
$repo.has_issues | Should -BeFalse
$repo.has_projects | Should -BeFalse
$repo.has_Wiki | Should -BeFalse
$repo.has_discussions | Should -BeTrue
$repo.allow_squash_merge | Should -BeFalse
$repo.allow_merge_commit | Should -BeFalse
$repo.allow_rebase_merge | Should -BeTrue
Expand Down Expand Up @@ -235,6 +239,7 @@ Describe 'GitHubRepositories\New-GitHubRepository' {
$repo.has_issues | Should -BeTrue
$repo.has_projects | Should -BeTrue
$repo.has_Wiki | Should -BeTrue
$repo.has_discussions | Should -BeFalse
$repo.allow_squash_merge | Should -BeTrue
$repo.allow_merge_commit | Should -BeTrue
$repo.allow_rebase_merge | Should -BeTrue
Expand Down