diff --git a/GitHubReleases.ps1 b/GitHubReleases.ps1 index d7f40878..d166691e 100644 --- a/GitHubReleases.ps1 +++ b/GitHubReleases.ps1 @@ -53,7 +53,7 @@ filter Get-GitHubRelease Gets all releases for the default configured owner/repository. .EXAMPLE - Get-GitHubRelease -ReleaseId 12345 + Get-GitHubRelease -Release 12345 Get a specific release for the default configured owner/repository @@ -244,7 +244,7 @@ filter New-GitHubRelease .PARAMETER Commitish The commitsh value that determines where the Git tag is created from. - Cn be any branch or commit SHA. Unused if the Git tag already exists. + Can be any branch or commit SHA. Unused if the Git tag already exists. Will default to the repository's default branch (usually 'master'). .PARAMETER Name @@ -303,6 +303,7 @@ filter New-GitHubRelease [string] $Name, + [Alias('Description')] [string] $Body, [switch] $Draft, @@ -391,7 +392,7 @@ filter Set-GitHubRelease .PARAMETER Commitish The commitsh value that determines where the Git tag is created from. - Cn be any branch or commit SHA. Unused if the Git tag already exists. + Can be any branch or commit SHA. Unused if the Git tag already exists. Will default to the repository's default branch (usually 'master'). .PARAMETER Name @@ -452,6 +453,7 @@ filter Set-GitHubRelease [string] $Name, + [Alias('Description')] [string] $Body, [switch] $Draft, @@ -904,7 +906,9 @@ filter New-GitHubReleaseAsset ParameterSetName='UploadUrl')] [string] $UploadUrl, - [Parameter(Mandatory)] + [Parameter( + Mandatory + ValueFromPipeline)] [ValidateScript({if (Test-Path -Path $_ -PathType Leaf) { $true } else { throw "$_ does not exist or is inaccessible." }})] [string] $Path, @@ -948,10 +952,10 @@ filter New-GitHubReleaseAsset $Path = Resolve-UnverifiedPath -Path $Path $file = Get-Item -Path $Path $fileName = $file.Name - $fileNameEncoded = [System.Web.HTTPUtility]::UrlEncode($fileName) + $fileNameEncoded = [Uri]::EscapeDataString($fileName) $queryParams = @("name=$fileNameEncoded") - $labelEncoded = [System.Web.HTTPUtility]::UrlEncode($Label) + $labelEncoded = [Uri]::EscapeDataString($Label) if (-not [String]::IsNullOrWhiteSpace($Label)) { $queryParams += "label=$labelEncoded" } $params = @{