A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/microsoft/PowerShellForGitHub/commit/e57a9563ef68f3a897c2b523e5ea0cbf23011d4c below:

Standardize verb usage within the module (#228) · microsoft/PowerShellForGitHub@e57a956 · GitHub

File tree Expand file treeCollapse file tree 13 files changed

+105

-100

lines changed

Filter options

Expand file treeCollapse file tree 13 files changed

+105

-100

lines changed Original file line number Diff line number Diff line change

@@ -247,7 +247,7 @@ filter Test-GitHubAssignee

247 247

}

248 248

}

249 249 250 -

function New-GitHubAssignee

250 +

function Add-GitHubAssignee

251 251

{

252 252

<#

253 253

.DESCRIPTION

@@ -308,15 +308,15 @@ function New-GitHubAssignee

308 308 309 309

.EXAMPLE

310 310

$assignees = @('octocat')

311 -

New-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1 -Assignee $assignee

311 +

Add-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1 -Assignee $assignee

312 312 313 313

Additionally assigns the usernames in $assignee to Issue #1

314 314

from the microsoft\PowerShellForGitHub project.

315 315 316 316

.EXAMPLE

317 317

$assignees = @('octocat')

318 318

$repo = Get-GitHubRepository -OwnerName microsoft -RepositoryName PowerShellForGitHub

319 -

$repo | New-GitHubAssignee -Issue 1 -Assignee $assignee

319 +

$repo | Add-GitHubAssignee -Issue 1 -Assignee $assignee

320 320 321 321

Additionally assigns the usernames in $assignee to Issue #1

322 322

from the microsoft\PowerShellForGitHub project.

@@ -325,14 +325,14 @@ function New-GitHubAssignee

325 325

$assignees = @('octocat')

326 326

Get-GitHubRepository -OwnerName microsoft -RepositoryName PowerShellForGitHub |

327 327

Get-GitHubIssue -Issue 1 |

328 -

New-GitHubAssignee -Assignee $assignee

328 +

Add-GitHubAssignee -Assignee $assignee

329 329 330 330

Additionally assigns the usernames in $assignee to Issue #1

331 331

from the microsoft\PowerShellForGitHub project.

332 332 333 333

.EXAMPLE

334 334

$octocat = Get-GitHubUser -UserName 'octocat'

335 -

$octocat | New-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1

335 +

$octocat | Add-GitHubAssignee -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 1

336 336 337 337

Additionally assigns the user 'octocat' to Issue #1

338 338

from the microsoft\PowerShellForGitHub project.

@@ -341,6 +341,7 @@ function New-GitHubAssignee

341 341

SupportsShouldProcess,

342 342

DefaultParameterSetName='Elements')]

343 343

[OutputType({$script:GitHubIssueTypeName})]

344 +

[Alias('New-GitHubAssignee')] # Non-standard usage of the New verb, but done to avoid a breaking change post 0.14.0

344 345

[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]

345 346

[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "", Justification="One or more parameters (like NoStatus) are only referenced by helper methods which get access to it from the stack via Get-Variable -Scope 1.")]

346 347

param(

Original file line number Diff line number Diff line change

@@ -654,14 +654,14 @@ filter New-GitHubIssue

654 654

return (Invoke-GHRestMethod @params | Add-GitHubIssueAdditionalProperties)

655 655

}

656 656 657 -

filter Update-GitHubIssue

657 +

filter Set-GitHubIssue

658 658

{

659 659

<#

660 660

.SYNOPSIS

661 -

Create a new Issue on GitHub.

661 +

Updates an Issue on GitHub.

662 662 663 663

.DESCRIPTION

664 -

Create a new Issue on GitHub.

664 +

Updates an Issue on GitHub.

665 665 666 666

The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub

667 667

@@ -744,12 +744,13 @@ filter Update-GitHubIssue

744 744

GitHub.Issue

745 745 746 746

.EXAMPLE

747 -

Update-GitHubIssue -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 4 -Title 'Test Issue' -State Closed

747 +

Set-GitHubIssue -OwnerName microsoft -RepositoryName PowerShellForGitHub -Issue 4 -Title 'Test Issue' -State Closed

748 748

#>

749 749

[CmdletBinding(

750 750

SupportsShouldProcess,

751 751

DefaultParameterSetName='Elements')]

752 752

[OutputType({$script:GitHubIssueTypeName})]

753 +

[Alias('Update-GitHubIssue')] # Non-standard usage of the Update verb, but done to avoid a breaking change post 0.14.0

753 754

[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]

754 755

param(

755 756

[Parameter(ParameterSetName='Elements')]

Original file line number Diff line number Diff line change

@@ -486,7 +486,7 @@ filter Remove-GitHubLabel

486 486

}

487 487

}

488 488 489 -

filter Update-GitHubLabel

489 +

filter Set-GitHubLabel

490 490

{

491 491

<#

492 492

.SYNOPSIS

@@ -555,7 +555,7 @@ filter Update-GitHubLabel

555 555

GitHub.Label

556 556 557 557

.EXAMPLE

558 -

Update-GitHubLabel -OwnerName microsoft -RepositoryName PowerShellForGitHub -Label TestLabel -NewName NewTestLabel -Color BBBB00

558 +

Set-GitHubLabel -OwnerName microsoft -RepositoryName PowerShellForGitHub -Label TestLabel -NewName NewTestLabel -Color BBBB00

559 559 560 560

Updates the existing label called TestLabel in the PowerShellForGitHub project to be called

561 561

'NewTestLabel' and be colored yellow.

@@ -564,6 +564,7 @@ filter Update-GitHubLabel

564 564

SupportsShouldProcess,

565 565

DefaultParameterSetName='Elements')]

566 566

[OutputType({$script:GitHubLabelTypeName})]

567 +

[Alias('Update-GitHubLabel')] # Non-standard usage of the Update verb, but done to avoid a breaking change post 0.14.0

567 568

[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]

568 569

param(

569 570

[Parameter(ParameterSetName='Elements')]

@@ -637,15 +638,15 @@ filter Update-GitHubLabel

637 638

return (Invoke-GHRestMethod @params | Add-GitHubLabelAdditionalProperties)

638 639

}

639 640 640 -

filter Set-GitHubLabel

641 +

filter Initialize-GitHubLabel

641 642

{

642 643

<#

643 644

.SYNOPSIS

644 -

Sets the entire set of Labels on the given GitHub repository to match the provided list

645 +

Replaces the entire set of Labels on the given GitHub repository to match the provided list

645 646

of Labels.

646 647 647 648

.DESCRIPTION

648 -

Sets the entire set of Labels on the given GitHub repository to match the provided list

649 +

Replaces the entire set of Labels on the given GitHub repository to match the provided list

649 650

of Labels.

650 651 651 652

Will update the color/description for any Labels already in the repository that match the

@@ -697,7 +698,7 @@ filter Set-GitHubLabel

697 698

GitHub.Repository

698 699 699 700

.EXAMPLE

700 -

Set-GitHubLabel -OwnerName microsoft -RepositoryName PowerShellForGitHub -Label @(@{'name' = 'TestLabel'; 'color' = 'EEEEEE'}, @{'name' = 'critical'; 'color' = 'FF000000'; 'description' = 'Needs immediate attention'})

701 +

Initialize-GitHubLabel -OwnerName microsoft -RepositoryName PowerShellForGitHub -Label @(@{'name' = 'TestLabel'; 'color' = 'EEEEEE'}, @{'name' = 'critical'; 'color' = 'FF000000'; 'description' = 'Needs immediate attention'})

701 702 702 703

Removes any labels not in this Label array, ensure the current assigned color and descriptions

703 704

match what's in the array for the labels that do already exist, and then creates new labels

@@ -769,7 +770,7 @@ filter Set-GitHubLabel

769 770

else

770 771

{

771 772

# Update label's color if it already exists

772 -

$null = Update-GitHubLabel -Label $labelToConfigure.name -NewName $labelToConfigure.name -Color $labelToConfigure.color @commonParams

773 +

$null = Set-GitHubLabel -Label $labelToConfigure.name -NewName $labelToConfigure.name -Color $labelToConfigure.color @commonParams

773 774

}

774 775

}

775 776 Original file line number Diff line number Diff line change

@@ -1015,11 +1015,11 @@ filter Rename-GitHubRepository

1015 1015

)

1016 1016 1017 1017

# This method was created by mistake and is now retained to avoid a breaking change.

1018 -

# Update-GitHubRepository is able to handle this scenario just fine.

1019 -

return Update-GitHubRepository @PSBoundParameters

1018 +

# Set-GitHubRepository is able to handle this scenario just fine.

1019 +

return Set-GitHubRepository @PSBoundParameters

1020 1020

}

1021 1021 1022 -

filter Update-GitHubRepository

1022 +

filter Set-GitHubRepository

1023 1023

{

1024 1024

<#

1025 1025

.SYNOPSIS

@@ -1125,18 +1125,18 @@ filter Update-GitHubRepository

1125 1125

GitHub.Repository

1126 1126 1127 1127

.EXAMPLE

1128 -

Update-GitHubRepository -OwnerName microsoft -RepositoryName PowerShellForGitHub -Description 'The best way to automate your GitHub interactions'

1128 +

Set-GitHubRepository -OwnerName microsoft -RepositoryName PowerShellForGitHub -Description 'The best way to automate your GitHub interactions'

1129 1129 1130 1130

Changes the description of the specified repository.

1131 1131 1132 1132

.EXAMPLE

1133 -

Update-GitHubRepository -Uri https://github.com/PowerShell/PowerShellForGitHub -Private:$false

1133 +

Set-GitHubRepository -Uri https://github.com/PowerShell/PowerShellForGitHub -Private:$false

1134 1134 1135 1135

Changes the visibility of the specified repository to be public.

1136 1136 1137 1137

.EXAMPLE

1138 1138

Get-GitHubRepository -Uri https://github.com/PowerShell/PowerShellForGitHub |

1139 -

Update-GitHubRepository -NewName 'PoShForGitHub' -Force

1139 +

Set-GitHubRepository -NewName 'PoShForGitHub' -Force

1140 1140 1141 1141

Renames the repository without any user confirmation prompting. This is identical to using

1142 1142

Rename-GitHubRepository -Uri https://github.com/PowerShell/PowerShellForGitHub -NewName 'PoShForGitHub' -Confirm:$false

@@ -1146,6 +1146,7 @@ filter Update-GitHubRepository

1146 1146

DefaultParameterSetName='Elements',

1147 1147

ConfirmImpact='High')]

1148 1148

[OutputType({$script:GitHubRepositoryTypeName})]

1149 +

[Alias('Update-GitHubRepository')] # Non-standard usage of the Update verb, but done to avoid a breaking change post 0.14.0

1149 1150

[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]

1150 1151

param(

1151 1152

[Parameter(ParameterSetName='Elements')]

Original file line number Diff line number Diff line change

@@ -300,14 +300,14 @@ filter Get-GitHubUserContextualInformation

300 300

return $result

301 301

}

302 302 303 -

function Update-GitHubCurrentUser

303 +

function Set-GitHubProfile

304 304

{

305 305

<#

306 306

.SYNOPSIS

307 -

Updates information about the current authenticated user on GitHub.

307 +

Updates profile information for the current authenticated user on GitHub.

308 308 309 309

.DESCRIPTION

310 -

Updates information about the current authenticated user on GitHub.

310 +

Updates profile information for the current authenticated user on GitHub.

311 311 312 312

The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub

313 313

@@ -347,13 +347,14 @@ function Update-GitHubCurrentUser

347 347

GitHub.User

348 348 349 349

.EXAMPLE

350 -

Update-GitHubCurrentUser -Location 'Seattle, WA' -Hireable:$false

350 +

Set-GitHubProfile -Location 'Seattle, WA' -Hireable:$false

351 351 352 352

Updates the current user to indicate that their location is "Seattle, WA" and that they

353 353

are not currently hireable.

354 354

#>

355 355

[CmdletBinding(SupportsShouldProcess)]

356 356

[OutputType({$script:GitHubUserTypeName})]

357 +

[Alias('Update-GitHubCurrentUser')] # Non-standard usage of the Update verb, but done to avoid a breaking change post 0.14.0

357 358

[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification="Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]

358 359

param(

359 360

[string] $Name,

Original file line number Diff line number Diff line change

@@ -55,6 +55,7 @@

55 55 56 56

# Functions to export from this module

57 57

FunctionsToExport = @(

58 +

'Add-GitHubAssignee',

58 59

'Add-GitHubIssueLabel',

59 60

'Backup-GitHubConfiguration',

60 61

'Clear-GitHubAuthentication',

@@ -102,14 +103,14 @@

102 103

'Get-GitHubViewTraffic',

103 104

'Group-GitHubIssue',

104 105

'Group-GitHubPullRequest',

106 +

'Initialize-GitHubLabel',

105 107

'Invoke-GHRestMethod',

106 108

'Invoke-GHRestMethodMultipleResult',

107 109

'Join-GitHubUri',

108 110

'Lock-GitHubIssue',

109 111

'Move-GitHubProjectCard',

110 112

'Move-GitHubProjectColumn',

111 113

'Move-GitHubRepositoryOwnership',

112 -

'New-GitHubAssignee',

113 114

'New-GitHubIssue',

114 115

'New-GitHubIssueComment',

115 116

'New-GitHubLabel',

@@ -136,24 +137,23 @@

136 137

'Set-GitHubAuthentication',

137 138

'Set-GitHubConfiguration',

138 139

'Set-GitHubContent',

140 +

'Set-GitHubIssue',

139 141

'Set-GitHubIssueComment',

140 142

'Set-GitHubIssueLabel',

141 143

'Set-GitHubLabel',

142 144

'Set-GitHubMilestone',

145 +

'Set-GitHubProfile',

143 146

'Set-GitHubProject',

144 147

'Set-GitHubProjectCard',

145 148

'Set-GitHubProjectColumn',

149 +

'Set-GitHubRepository'

146 150

'Set-GitHubRepositoryTopic',

147 151

'Split-GitHubUri',

148 152

'Test-GitHubAssignee',

149 153

'Test-GitHubAuthenticationConfigured',

150 154

'Test-GitHubOrganizationMember',

151 155

'Test-GitHubRepositoryVulnerabilityAlert',

152 -

'Unlock-GitHubIssue',

153 -

'Update-GitHubCurrentUser',

154 -

'Update-GitHubIssue',

155 -

'Update-GitHubLabel',

156 -

'Update-GitHubRepository'

156 +

'Unlock-GitHubIssue'

157 157

)

158 158 159 159

AliasesToExport = @(

@@ -167,10 +167,15 @@

167 167

'Delete-GitHubRepository',

168 168

'Get-GitHubBranch',

169 169

'Get-GitHubComment',

170 +

'New-GitHubAssignee',

170 171

'New-GitHubComment',

171 172

'Remove-GitHubComment',

172 173

'Set-GitHubComment',

173 174

'Transfer-GitHubRepositoryOwnership'

175 +

'Update-GitHubIssue',

176 +

'Update-GitHubLabel',

177 +

'Update-GitHubCurrentUser',

178 +

'Update-GitHubRepository'

174 179

)

175 180 176 181

# Cmdlets to export from this module

Original file line number Diff line number Diff line change

@@ -112,7 +112,7 @@ try

112 112

$issue.assignees | Should -BeNullOrEmpty

113 113

}

114 114 115 -

$updatedIssue = New-GitHubAssignee -OwnerName $script:ownerName -RepositoryName $repo.name -Issue $issue.number -Assignee $owner.login

115 +

$updatedIssue = Add-GitHubAssignee -OwnerName $script:ownerName -RepositoryName $repo.name -Issue $issue.number -Assignee $owner.login

116 116

It 'Should have returned the same issue' {

117 117

$updatedIssue.number | Should -Be $issue.number

118 118

}

@@ -149,7 +149,7 @@ try

149 149

$issue.assignees | Should -BeNullOrEmpty

150 150

}

151 151 152 -

$updatedIssue = $repo | New-GitHubAssignee -Issue $issue.number -Assignee $owner.login

152 +

$updatedIssue = $repo | Add-GitHubAssignee -Issue $issue.number -Assignee $owner.login

153 153

It 'Should have returned the same issue' {

154 154

$updatedIssue.number | Should -Be $issue.number

155 155

}

@@ -186,7 +186,7 @@ try

186 186

$issue.assignees | Should -BeNullOrEmpty

187 187

}

188 188 189 -

$updatedIssue = $issue | New-GitHubAssignee -Assignee $owner.login

189 +

$updatedIssue = $issue | Add-GitHubAssignee -Assignee $owner.login

190 190

It 'Should have returned the same issue' {

191 191

$updatedIssue.number | Should -Be $issue.number

192 192

}

@@ -223,7 +223,7 @@ try

223 223

$issue.assignees | Should -BeNullOrEmpty

224 224

}

225 225 226 -

$updatedIssue = $owner | New-GitHubAssignee -OwnerName $script:ownerName -RepositoryName $repo.name -Issue $issue.number

226 +

$updatedIssue = $owner | Add-GitHubAssignee -OwnerName $script:ownerName -RepositoryName $repo.name -Issue $issue.number

227 227

It 'Should have returned the same issue' {

228 228

$updatedIssue.number | Should -Be $issue.number

229 229

}

Original file line number Diff line number Diff line change

@@ -45,7 +45,7 @@ try

45 45 46 46

Context 'For getting Issue events from a repository' {

47 47

$issue = $repo | New-GitHubIssue -Title 'New Issue'

48 -

$issue = $issue | Update-GitHubIssue -State Closed

48 +

$issue = $issue | Set-GitHubIssue -State Closed

49 49

$events = @($repo | Get-GitHubEvent)

50 50 51 51

It 'Should have an event from closing an issue' {

@@ -82,8 +82,8 @@ try

82 82

}

83 83 84 84

Context 'For getting events from an issue' {

85 -

$issue = $issue | Update-GitHubIssue -State Closed

86 -

$issue = $issue | Update-GitHubIssue -State Open

85 +

$issue = $issue | Set-GitHubIssue -State Closed

86 +

$issue = $issue | Set-GitHubIssue -State Open

87 87

$events = @(Get-GitHubEvent -OwnerName $ownerName -RepositoryName $repositoryName)

88 88 89 89

It 'Should have two events from closing and opening the issue' {

@@ -98,8 +98,8 @@ try

98 98

$repositoryName = [Guid]::NewGuid()

99 99

$repo = New-GitHubRepository -RepositoryName $repositoryName

100 100

$issue = $repo | New-GitHubIssue -Title 'New Issue'

101 -

$issue = $issue | Update-GitHubIssue -State Closed

102 -

$issue = $issue | Update-GitHubIssue -State Open

101 +

$issue = $issue | Set-GitHubIssue -State Closed

102 +

$issue = $issue | Set-GitHubIssue -State Open

103 103

$events = @($repo | Get-GitHubEvent)

104 104

}

105 105

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4