@@ -40,7 +40,7 @@ function New-GitHubRepository
40
40
This is only valid when creating a repository in an organization.
41
41
42
42
. PARAMETER Private
43
- By default, this repository will created Public. Specify this to create
43
+ By default, this repository will be created Public. Specify this to create
44
44
a private repository.
45
45
46
46
. PARAMETER NoIssues
@@ -69,6 +69,12 @@ function New-GitHubRepository
69
69
By default, rebase-merge pull requests will be allowed.
70
70
Specify this to disallow.
71
71
72
+ . PARAMETER DeleteBranchOnMerge
73
+ Specifies the automatic deleting of head branches when pull requests are merged.
74
+
75
+ . PARAMETER IsTemplate
76
+ Specifies whether the repository is made available as a template.
77
+
72
78
. PARAMETER AccessToken
73
79
If provided, this will be used as the AccessToken for authentication with the
74
80
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
@@ -120,6 +126,10 @@ function New-GitHubRepository
120
126
121
127
[switch ] $DisallowRebaseMerge ,
122
128
129
+ [switch ] $DeleteBranchOnMerge ,
130
+
131
+ [switch ] $IsTemplate ,
132
+
123
133
[string ] $AccessToken ,
124
134
125
135
[switch ] $NoStatus
@@ -163,12 +173,15 @@ function New-GitHubRepository
163
173
if ($PSBoundParameters.ContainsKey (' DisallowSquashMerge' )) { $hashBody [' allow_squash_merge' ] = (-not $DisallowSquashMerge.ToBool ()) }
164
174
if ($PSBoundParameters.ContainsKey (' DisallowMergeCommit' )) { $hashBody [' allow_merge_commit' ] = (-not $DisallowMergeCommit.ToBool ()) }
165
175
if ($PSBoundParameters.ContainsKey (' DisallowRebaseMerge' )) { $hashBody [' allow_rebase_merge' ] = (-not $DisallowRebaseMerge.ToBool ()) }
176
+ if ($PSBoundParameters.ContainsKey (' DeleteBranchOnMerge' )) { $hashBody [' delete_branch_on_merge' ] = $DeleteBranchOnMerge.ToBool () }
177
+ if ($PSBoundParameters.ContainsKey (' IsTemplate' )) { $hashBody [' is_template' ] = $IsTemplate.ToBool () }
166
178
167
179
$params = @ {
168
180
' UriFragment' = $uriFragment
169
181
' Body' = (ConvertTo-Json - InputObject $hashBody )
170
182
' Method' = ' Post'
171
- ' Description' = " Creating $RepositoryName "
183
+ ' AcceptHeader' = $script :baptisteAcceptHeader
184
+ ' Description' = " Creating $RepositoryName "
172
185
' AccessToken' = $AccessToken
173
186
' TelemetryEventName' = $MyInvocation.MyCommand.Name
174
187
' TelemetryProperties' = $telemetryProperties
@@ -743,6 +756,12 @@ function Update-GitHubRepository
743
756
By default, rebase-merge pull requests will be allowed.
744
757
Specify this to disallow.
745
758
759
+ . PARAMETER DeleteBranchOnMerge
760
+ Specifies the automatic deleting of head branches when pull requests are merged.
761
+
762
+ . PARAMETER IsTemplate
763
+ Specifies whether the repository is made available as a template.
764
+
746
765
. PARAMETER Archived
747
766
Specify this to archive this repository.
748
767
NOTE: You cannot unarchive repositories through the API / this module.
@@ -760,8 +779,12 @@ function Update-GitHubRepository
760
779
. EXAMPLE
761
780
Update-GitHubRepository -OwnerName Microsoft -RepositoryName PowerShellForGitHub -Description 'The best way to automate your GitHub interactions'
762
781
782
+ Changes the description of the specified repository.
783
+
763
784
. EXAMPLE
764
785
Update-GitHubRepository -Uri https://github.com./PowerShell/PowerShellForGitHub -Private:$false
786
+
787
+ Changes the visibility of the specified repository to be public.
765
788
#>
766
789
[CmdletBinding (
767
790
SupportsShouldProcess ,
@@ -799,6 +822,10 @@ function Update-GitHubRepository
799
822
800
823
[switch ] $DisallowRebaseMerge ,
801
824
825
+ [switch ] $DeleteBranchOnMerge ,
826
+
827
+ [switch ] $IsTemplate ,
828
+
802
829
[switch ] $Archived ,
803
830
804
831
[string ] $AccessToken ,
@@ -831,12 +858,15 @@ function Update-GitHubRepository
831
858
if ($PSBoundParameters.ContainsKey (' DisallowSquashMerge' )) { $hashBody [' allow_squash_merge' ] = (-not $DisallowSquashMerge.ToBool ()) }
832
859
if ($PSBoundParameters.ContainsKey (' DisallowMergeCommit' )) { $hashBody [' allow_merge_commit' ] = (-not $DisallowMergeCommit.ToBool ()) }
833
860
if ($PSBoundParameters.ContainsKey (' DisallowRebaseMerge' )) { $hashBody [' allow_rebase_merge' ] = (-not $DisallowRebaseMerge.ToBool ()) }
861
+ if ($PSBoundParameters.ContainsKey (' DeleteBranchOnMerge' )) { $hashBody [' delete_branch_on_merge' ] = $DeleteBranchOnMerge.ToBool () }
862
+ if ($PSBoundParameters.ContainsKey (' IsTemplate' )) { $hashBody [' is_template' ] = $IsTemplate.ToBool () }
834
863
if ($PSBoundParameters.ContainsKey (' Archived' )) { $hashBody [' archived' ] = $Archived.ToBool () }
835
864
836
865
$params = @ {
837
866
' UriFragment' = " repos/$OwnerName /$RepositoryName "
838
867
' Body' = (ConvertTo-Json - InputObject $hashBody )
839
868
' Method' = ' Patch'
869
+ ' AcceptHeader' = $script :baptisteAcceptHeader
840
870
' Description' = " Updating $RepositoryName "
841
871
' AccessToken' = $AccessToken
842
872
' TelemetryEventName' = $MyInvocation.MyCommand.Name
0 commit comments