Skip to content

Commit 8a45dbd

Browse files
committed
Applying more CR feedback
1 parent d55d026 commit 8a45dbd

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

GitHubReleases.ps1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ filter New-GitHubRelease
253253
254254
.PARAMETER Commitish
255255
The commitsh value that determines where the Git tag is created from.
256-
Cn be any branch or commit SHA. Unused if the Git tag already exists.
256+
Can be any branch or commit SHA. Unused if the Git tag already exists.
257257
Will default to the repository's default branch (usually 'master').
258258
259259
.PARAMETER Name
@@ -312,6 +312,7 @@ filter New-GitHubRelease
312312

313313
[string] $Name,
314314

315+
[Alias('Description')]
315316
[string] $Body,
316317

317318
[switch] $Draft,
@@ -400,7 +401,7 @@ filter Set-GitHubRelease
400401
401402
.PARAMETER Commitish
402403
The commitsh value that determines where the Git tag is created from.
403-
Cn be any branch or commit SHA. Unused if the Git tag already exists.
404+
Can be any branch or commit SHA. Unused if the Git tag already exists.
404405
Will default to the repository's default branch (usually 'master').
405406
406407
.PARAMETER Name
@@ -461,6 +462,7 @@ filter Set-GitHubRelease
461462

462463
[string] $Name,
463464

465+
[Alias('Description')]
464466
[string] $Body,
465467

466468
[switch] $Draft,
@@ -913,7 +915,9 @@ filter New-GitHubReleaseAsset
913915
ParameterSetName='UploadUrl')]
914916
[string] $UploadUrl,
915917

916-
[Parameter(Mandatory)]
918+
[Parameter(
919+
Mandatory
920+
ValueFromPipeline)]
917921
[ValidateScript({if (Test-Path -Path $_ -PathType Leaf) { $true } else { throw "$_ does not exist or is inaccessible." }})]
918922
[string] $Path,
919923

@@ -957,10 +961,10 @@ filter New-GitHubReleaseAsset
957961
$Path = Resolve-UnverifiedPath -Path $Path
958962
$file = Get-Item -Path $Path
959963
$fileName = $file.Name
960-
$fileNameEncoded = [System.Web.HTTPUtility]::UrlEncode($fileName)
964+
$fileNameEncoded = [Uri]::EscapeDataString($fileName)
961965
$queryParams = @("name=$fileNameEncoded")
962966

963-
$labelEncoded = [System.Web.HTTPUtility]::UrlEncode($Label)
967+
$labelEncoded = [Uri]::EscapeDataString($Label)
964968
if (-not [String]::IsNullOrWhiteSpace($Label)) { $queryParams += "label=$labelEncoded" }
965969

966970
$params = @{

0 commit comments

Comments
 (0)