@@ -26,7 +26,7 @@ function Get-GitHubIssueComment
26
26
Issue number to receive comments for.
27
27
28
28
. PARAMETER Since
29
- Only comments updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
29
+ Only comments updated at or after this time are returned.
30
30
31
31
. PARAMETER AccessToken
32
32
If provided, this will be used as the AccessToken for authentication with the
@@ -62,33 +62,37 @@ function Get-GitHubIssueComment
62
62
[Parameter (Mandatory )]
63
63
[int ] $IssueNumber ,
64
64
65
- [string ] $Since ,
65
+ [DateTime ] $Since ,
66
66
67
67
[string ] $AccessToken ,
68
68
69
69
[switch ] $NoStatus
70
70
)
71
71
72
- Write-InvocationLog - Invocation $MyInvocation
72
+ Write-InvocationLog
73
73
74
- $elements = Resolve-RepositoryElements - BoundParameters $PSBoundParameters
74
+ $elements = Resolve-RepositoryElements
75
75
$OwnerName = $elements.ownerName
76
76
$RepositoryName = $elements.repositoryName
77
77
78
+ if ($Since -ne $null ) {
79
+ $SinceFormattedTime = $Since.ToUniversalTime ().ToString(' o' )
80
+ }
81
+
78
82
$telemetryProperties = @ {
79
83
' OwnerName' = (Get-PiiSafeString - PlainText $OwnerName )
80
84
' RepositoryName' = (Get-PiiSafeString - PlainText $RepositoryName )
81
- ' Number ' = $IssueNumber
82
- ' Since' = $Since
85
+ ' IssueNumber ' = $IssueNumber
86
+ ' Since' = $SinceFormattedTime
83
87
}
84
88
85
89
$params = @ {
86
- ' UriFragment' = " repos/$OwnerName /$RepositoryName /issues/$IssueNumber /comments`?since=$Since "
90
+ ' UriFragment' = " repos/$OwnerName /$RepositoryName /issues/$IssueNumber /comments`?since=$SinceFormattedTime "
87
91
' Description' = " Getting comments for issue $IssueNumber in $RepositoryName "
88
92
' AccessToken' = $AccessToken
89
93
' TelemetryEventName' = $MyInvocation.MyCommand.Name
90
94
' TelemetryProperties' = $telemetryProperties
91
- ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - BoundParameters $PSBoundParameters - Name NoStatus - ConfigValueName DefaultNoStatus)
95
+ ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
92
96
}
93
97
94
98
return Invoke-GHRestMethodMultipleResult @params
@@ -122,7 +126,7 @@ function Get-GitHubRepositoryComment
122
126
How to list the results, either asc or desc. Ignored without the sort parameter.
123
127
124
128
. PARAMETER Since
125
- Only comments updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
129
+ Only comments updated at or after this time are returned.
126
130
127
131
. PARAMETER AccessToken
128
132
If provided, this will be used as the AccessToken for authentication with the
@@ -161,32 +165,36 @@ function Get-GitHubRepositoryComment
161
165
[ValidateSet (' asc' , ' desc' )]
162
166
[string ] $Direction ,
163
167
164
- [string ] $Since ,
168
+ [DateTime ] $Since ,
165
169
166
170
[string ] $AccessToken ,
167
171
168
172
[switch ] $NoStatus
169
173
)
170
174
171
- Write-InvocationLog - Invocation $MyInvocation
175
+ Write-InvocationLog
172
176
173
- $elements = Resolve-RepositoryElements - BoundParameters $PSBoundParameters
177
+ $elements = Resolve-RepositoryElements
174
178
$OwnerName = $elements.ownerName
175
179
$RepositoryName = $elements.repositoryName
176
180
181
+ if ($Since -ne $null ) {
182
+ $SinceFormattedTime = $Since.ToUniversalTime ().ToString(' o' )
183
+ }
184
+
177
185
$telemetryProperties = @ {
178
186
' OwnerName' = (Get-PiiSafeString - PlainText $OwnerName )
179
187
' RepositoryName' = (Get-PiiSafeString - PlainText $RepositoryName )
180
- ' Number ' = $IssueNumber
181
- ' Sort' = $State
182
- ' Direction' = $Sort
183
- ' Since' = $Direction
188
+ ' IssueNumber ' = $IssueNumber
189
+ ' Sort' = $Sort
190
+ ' Direction' = $Direction
191
+ ' Since' = $SinceFormattedTime
184
192
}
185
193
186
194
$getParams = @ (
187
195
" sort=$Sort " ,
188
196
" direction=$Direction " ,
189
- " since=$Since "
197
+ " since=$SinceFormattedTime "
190
198
)
191
199
192
200
$params = @ {
@@ -196,7 +204,7 @@ function Get-GitHubRepositoryComment
196
204
' AccessToken' = $AccessToken
197
205
' TelemetryEventName' = $MyInvocation.MyCommand.Name
198
206
' TelemetryProperties' = $telemetryProperties
199
- ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - BoundParameters $PSBoundParameters - Name NoStatus - ConfigValueName DefaultNoStatus)
207
+ ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
200
208
}
201
209
202
210
return Invoke-GHRestMethod @params
@@ -264,9 +272,9 @@ function Get-GitHubComment
264
272
[switch ] $NoStatus
265
273
)
266
274
267
- Write-InvocationLog - Invocation $MyInvocation
275
+ Write-InvocationLog
268
276
269
- $elements = Resolve-RepositoryElements - BoundParameters $PSBoundParameters
277
+ $elements = Resolve-RepositoryElements
270
278
$OwnerName = $elements.ownerName
271
279
$RepositoryName = $elements.repositoryName
272
280
@@ -283,7 +291,7 @@ function Get-GitHubComment
283
291
' AccessToken' = $AccessToken
284
292
' TelemetryEventName' = $MyInvocation.MyCommand.Name
285
293
' TelemetryProperties' = $telemetryProperties
286
- ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - BoundParameters $PSBoundParameters - Name NoStatus - ConfigValueName DefaultNoStatus)
294
+ ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
287
295
}
288
296
289
297
return Invoke-GHRestMethod @params
@@ -358,9 +366,9 @@ function New-GitHubComment
358
366
[switch ] $NoStatus
359
367
)
360
368
361
- Write-InvocationLog - Invocation $MyInvocation
369
+ Write-InvocationLog
362
370
363
- $elements = Resolve-RepositoryElements - BoundParameters $PSBoundParameters
371
+ $elements = Resolve-RepositoryElements
364
372
$OwnerName = $elements.ownerName
365
373
$RepositoryName = $elements.repositoryName
366
374
@@ -382,7 +390,7 @@ function New-GitHubComment
382
390
' AccessToken' = $AccessToken
383
391
' TelemetryEventName' = $MyInvocation.MyCommand.Name
384
392
' TelemetryProperties' = $telemetryProperties
385
- ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - BoundParameters $PSBoundParameters - Name NoStatus - ConfigValueName DefaultNoStatus)
393
+ ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
386
394
}
387
395
388
396
return Invoke-GHRestMethod @params
@@ -457,9 +465,9 @@ function Edit-GitHubComment
457
465
[switch ] $NoStatus
458
466
)
459
467
460
- Write-InvocationLog - Invocation $MyInvocation
468
+ Write-InvocationLog
461
469
462
- $elements = Resolve-RepositoryElements - BoundParameters $PSBoundParameters
470
+ $elements = Resolve-RepositoryElements
463
471
$OwnerName = $elements.ownerName
464
472
$RepositoryName = $elements.repositoryName
465
473
@@ -481,7 +489,7 @@ function Edit-GitHubComment
481
489
' AccessToken' = $AccessToken
482
490
' TelemetryEventName' = $MyInvocation.MyCommand.Name
483
491
' TelemetryProperties' = $telemetryProperties
484
- ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - BoundParameters $PSBoundParameters - Name NoStatus - ConfigValueName DefaultNoStatus)
492
+ ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
485
493
}
486
494
487
495
return Invoke-GHRestMethod @params
@@ -550,9 +558,9 @@ function Remove-GitHubComment
550
558
[switch ] $NoStatus
551
559
)
552
560
553
- Write-InvocationLog - Invocation $MyInvocation
561
+ Write-InvocationLog
554
562
555
- $elements = Resolve-RepositoryElements - BoundParameters $PSBoundParameters
563
+ $elements = Resolve-RepositoryElements
556
564
$OwnerName = $elements.ownerName
557
565
$RepositoryName = $elements.repositoryName
558
566
@@ -569,7 +577,7 @@ function Remove-GitHubComment
569
577
' AccessToken' = $AccessToken
570
578
' TelemetryEventName' = $MyInvocation.MyCommand.Name
571
579
' TelemetryProperties' = $telemetryProperties
572
- ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - BoundParameters $PSBoundParameters - Name NoStatus - ConfigValueName DefaultNoStatus)
580
+ ' NoStatus' = (Resolve-ParameterWithDefaultConfigurationValue - Name NoStatus - ConfigValueName DefaultNoStatus)
573
581
}
574
582
575
583
return Invoke-GHRestMethod @params
0 commit comments