@@ -29,7 +29,7 @@ function Get-GitHubMilestone
29
29
How to sort the results, either due_on or completeness. Default: due_on
30
30
31
31
. PARAMETER Direction
32
- How to list the results, either asc or desc. Ignored without the sort parameter.
32
+ How to list the results, either asc or desc. Ignored without the sort parameter. Default: asc
33
33
34
34
. PARAMETER State
35
35
Only milestones with this state are returned, either open, closed, or all. Default: open
@@ -70,11 +70,11 @@ function Get-GitHubMilestone
70
70
[Parameter (ParameterSetName = ' RepositoryUri' )]
71
71
[Parameter (ParameterSetName = ' RepositoryElements' )]
72
72
[ValidateSet (' open' , ' closed' , ' all' )]
73
- [DateTime ] $State ,
73
+ [string ] $State ,
74
74
75
75
[Parameter (ParameterSetName = ' RepositoryUri' )]
76
76
[Parameter (ParameterSetName = ' RepositoryElements' )]
77
- [ValidateSet (' created ' , ' updated ' )]
77
+ [ValidateSet (' due_on ' , ' completeness ' )]
78
78
[string ] $Sort ,
79
79
80
80
[Parameter (ParameterSetName = ' RepositoryUri' )]
@@ -229,11 +229,6 @@ function New-GitHubMilestone
229
229
$OwnerName = $elements.ownerName
230
230
$RepositoryName = $elements.repositoryName
231
231
232
- if ($null -ne $Due_On )
233
- {
234
- $DueOnFormattedTime = $Due_On.ToUniversalTime ().ToString(' o' )
235
- }
236
-
237
232
$telemetryProperties = @ {
238
233
' OwnerName' = (Get-PiiSafeString - PlainText $OwnerName )
239
234
' RepositoryName' = (Get-PiiSafeString - PlainText $RepositoryName )
@@ -246,17 +241,18 @@ function New-GitHubMilestone
246
241
247
242
if ($PSBoundParameters.ContainsKey (' State' ))
248
243
{
249
- $hashBody += " state= $State "
244
+ $hashBody.add ( ' state' , $State )
250
245
}
251
246
252
247
if ($PSBoundParameters.ContainsKey (' Description' ))
253
248
{
254
- $hashBody += " description= $Description "
249
+ $hashBody.add ( ' description' , $Description )
255
250
}
256
251
257
- if ($PSBoundParameters.ContainsKey (' Due_On' ))
252
+ if ($PSBoundParameters.ContainsKey (' Due_On' ) -and $null -ne $Due_On )
258
253
{
259
- $hashBody += " due_on=$DueOnFormattedTime "
254
+ $DueOnFormattedTime = $Due_On.ToUniversalTime ().ToString(' o' )
255
+ $hashBody.add (' due_on' , $DueOnFormattedTime )
260
256
}
261
257
262
258
$params = @ {
@@ -277,7 +273,7 @@ function Set-GitHubMilestone
277
273
{
278
274
<#
279
275
. DESCRIPTION
280
- Set an existing milestone for the given repository
276
+ Update an existing milestone for the given repository
281
277
282
278
The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub
283
279
@@ -370,11 +366,6 @@ function Set-GitHubMilestone
370
366
$OwnerName = $elements.ownerName
371
367
$RepositoryName = $elements.repositoryName
372
368
373
- if ($null -ne $Due_On )
374
- {
375
- $DueOnFormattedTime = $Due_On.ToUniversalTime ().ToString(' o' )
376
- }
377
-
378
369
$telemetryProperties = @ {
379
370
' OwnerName' = (Get-PiiSafeString - PlainText $OwnerName )
380
371
' RepositoryName' = (Get-PiiSafeString - PlainText $RepositoryName )
@@ -388,17 +379,18 @@ function Set-GitHubMilestone
388
379
389
380
if ($PSBoundParameters.ContainsKey (' State' ))
390
381
{
391
- $hashBody += " state= $State "
382
+ $hashBody.add ( ' state' , $State )
392
383
}
393
384
394
385
if ($PSBoundParameters.ContainsKey (' Description' ))
395
386
{
396
- $hashBody += " description= $Description "
387
+ $hashBody.add ( ' description' , $Description )
397
388
}
398
389
399
- if ($PSBoundParameters.ContainsKey (' Due_On' ))
390
+ if ($PSBoundParameters.ContainsKey (' Due_On' ) -and $null -ne $Due_On )
400
391
{
401
- $hashBody += " due_on=$DueOnFormattedTime "
392
+ $DueOnFormattedTime = $Due_On.ToUniversalTime ().ToString(' o' )
393
+ $hashBody.add (' due_on' , $DueOnFormattedTime )
402
394
}
403
395
404
396
$params = @ {
0 commit comments