Skip to content

Commit 8e11d53

Browse files
committed
Adding to usage.md
1 parent 10e6b1f commit 8e11d53

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

GitHubComments.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function Get-GitHubRepositoryComment
135135
If not supplied here, the DefaultNoStatus configuration property value will be used.
136136
137137
.EXAMPLE
138-
Get-GitHubReferrerTraffic -OwnerName Powershell -RepositoryName PowerShellForGitHub
138+
Get-GitHubRepositoryComment -OwnerName Powershell -RepositoryName PowerShellForGitHub -Sort created -Direction asc -Since 2011-04-14T16:00:49Z
139139
140140
Get the comments for the PowerShell\PowerShellForGitHub project.
141141
#>

Tests/GitHubComments.tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Reset-GitHubConfiguration
8383
Set-Variable -Force -Scope Script -Option ReadOnly -Visibility Private -Name $_.Key -Value $_.Value
8484
}
8585

86-
Describe 'Creating a new comment' {
86+
Describe 'Creating, modifying and deleting comments' {
8787
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid) -AutoInit
8888

8989
$issue = New-GitHubIssue -Uri $repo.svn_url -Title $defaultIssueTitle

USAGE.md

+39-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
* [Get the popular content for a repository](#get-the-popular-content-for-a-repository)
3131
* [Get the number of views for a repository](#get-the-number-of-views-for-a-repository)
3232
* [Get the number of clones for a repository](#get-the-number-of-clones-for-a-repository)
33-
33+
* [Comments](#comments)
34+
* [Get comments from an issue](#get-comments-from-an-issue)
35+
* [Get comments from a repository](#get-comments-from-a-repository)
36+
* [Get a single comment](#get-a-single-comment)
37+
* [Adding a new comment to an issue](#adding-a-new-comment-to-an-issue)
38+
* [Editing an existing comment](#editing-an-existing-comment)
39+
* [Removing a comment](#removing-a-comment)
3440
----------
3541

3642
## Logging
@@ -342,3 +348,35 @@ Get-GitHubViewTraffic -OwnerName PowerShell -RepositoryName PowerShellForGitHub
342348
```powershell
343349
Get-GitHubCloneTraffic -OwnerName PowerShell -RepositoryName PowerShellForGitHub -Per 'day'
344350
```
351+
352+
### Comments
353+
354+
#### Get comments from an issue
355+
```powershell
356+
Get-GitHubIssueComment -OwnerName Powershell -RepositoryName PowerShellForGitHub -IssueNumber 1
357+
```
358+
359+
#### Get comments from a repository
360+
```powershell
361+
Get-GitHubRepositoryComment -OwnerName Powershell -RepositoryName PowerShellForGitHub -Sort created -Direction asc -Since '2011-04-14T16:00:49Z'
362+
```
363+
364+
#### Get a single comment
365+
```powershell
366+
Get-GitHubComment -OwnerName Powershell -RepositoryName PowerShellForGitHub -CommentID 1
367+
```
368+
369+
#### Adding a new comment to an issue
370+
```powershell
371+
New-GitHubComment -OwnerName Powershell -RepositoryName PowerShellForGitHub -IssueNumber 1 -Body "Testing this API"
372+
```
373+
374+
#### Editing an existing comment
375+
```powershell
376+
Edit-GitHubComment -OwnerName Powershell -RepositoryName PowerShellForGitHub -CommentID 1 -Body "Testing this API"
377+
```
378+
379+
#### Removing a comment
380+
```powershell
381+
Remove-GitHubComment -OwnerName Powershell -RepositoryName PowerShellForGitHub -CommentID 1
382+
```

0 commit comments

Comments
 (0)