diff --git a/src/functions/public/Actions/Stop-GitHubWorkflowRun.ps1 b/src/functions/public/Actions/Stop-GitHubWorkflowRun.ps1 index ba014cc3e..0d42b6a83 100644 --- a/src/functions/public/Actions/Stop-GitHubWorkflowRun.ps1 +++ b/src/functions/public/Actions/Stop-GitHubWorkflowRun.ps1 @@ -42,5 +42,4 @@ Write-Output $_.Response } } - } diff --git a/src/functions/public/Apps/Get-GitHubAppInstallationAccessToken.ps1 b/src/functions/public/Apps/New-GitHubAppInstallationAccessToken.ps1 similarity index 77% rename from src/functions/public/Apps/Get-GitHubAppInstallationAccessToken.ps1 rename to src/functions/public/Apps/New-GitHubAppInstallationAccessToken.ps1 index 058a26e9b..5fa32da7e 100644 --- a/src/functions/public/Apps/Get-GitHubAppInstallationAccessToken.ps1 +++ b/src/functions/public/Apps/New-GitHubAppInstallationAccessToken.ps1 @@ -1,4 +1,4 @@ -function Get-GitHubAppInstallationAccessToken { +filter New-GitHubAppInstallationAccessToken { <# .SYNOPSIS Create an installation access token for an app @@ -28,19 +28,34 @@ to access this endpoint. .EXAMPLE - Get-GitHubAppInstallationAccessToken -InstallationID 12345678 + New-GitHubAppInstallationAccessToken -InstallationID 12345678 - Gets an installation access token for the installation with the ID `12345678`. + Creates an installation access token for the installation with the ID `12345678`. + + .EXAMPLE + Connect-GitHub -ClientID $ClientID -PrivateKey $PrivateKey -Verbose + Get-GitHubAppInstallation | New-GitHubAppInstallationAccessToken + + Gets the GitHub App installations and creates an installation access token for each installation. .NOTES [Create an installation access token for an app](https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app) #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSUseShouldProcessForStateChangingFunctions', '', + Justification = 'No state is changed.' + )] [CmdletBinding()] param ( # The unique identifier of the installation. # Example: '12345678' - [Parameter(Mandatory)] - [string] $InstallationID + [Parameter( + Mandatory, + ValueFromPipeline, + ValueFromPipelineByPropertyName + )] + [Alias('ID')] + [int] $InstallationID ) $inputObject = @{