diff --git a/src/GitHub/data/Auth.psd1 b/src/GitHub/data/Auth.psd1 index 9a306d5c..98d42943 100644 --- a/src/GitHub/data/Auth.psd1 +++ b/src/GitHub/data/Auth.psd1 @@ -1,8 +1,8 @@ @{ - GitHubApp = @{ + GitHubApp = @{ ClientID = 'Iv1.f26b61bc99e69405' # $script:Auth.GitHubApp.ClientID } - OAuthApp = @{ + OAuthApp = @{ ClientID = '7204ae9b0580f2cb8288' # $script:Auth.OAuthApp.ClientID } AccessTokenGracePeriodInHours = 4 diff --git a/src/GitHub/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 b/src/GitHub/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 index 6bc64b2d..1fc23726 100644 --- a/src/GitHub/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 +++ b/src/GitHub/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 @@ -18,6 +18,7 @@ https://docs.github.com/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#device-flow #> [OutputType([void])] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Justification = 'Is the CLI part of the module.')] [CmdletBinding()] param( # The Client ID of the GitHub App. diff --git a/src/GitHub/private/Config/Initialize-SecretVault.ps1 b/src/GitHub/private/Config/Initialize-SecretVault.ps1 index b17dee6f..e39dd3d9 100644 --- a/src/GitHub/private/Config/Initialize-SecretVault.ps1 +++ b/src/GitHub/private/Config/Initialize-SecretVault.ps1 @@ -4,21 +4,21 @@ function Initialize-SecretVault { <# - .SYNOPSIS - Initialize a secret vault. + .SYNOPSIS + Initialize a secret vault. - .DESCRIPTION - Initialize a secret vault. If the vault does not exist, it will be created. + .DESCRIPTION + Initialize a secret vault. If the vault does not exist, it will be created. - .EXAMPLE - Initialize-SecretVault -Name 'SecretStore' -Type 'Microsoft.PowerShell.SecretStore' + .EXAMPLE + Initialize-SecretVault -Name 'SecretStore' -Type 'Microsoft.PowerShell.SecretStore' - Initializes a secret vault named 'SecretStore' using the 'Microsoft.PowerShell.SecretStore' module. + Initializes a secret vault named 'SecretStore' using the 'Microsoft.PowerShell.SecretStore' module. - .NOTES - For more information about secret vaults, see https://learn.microsoft.com/en-us/powershell/utility-modules/secretmanagement/overview?view=ps-modules + .NOTES + For more information about secret vaults, see + https://learn.microsoft.com/en-us/powershell/utility-modules/secretmanagement/overview?view=ps-modules #> - [OutputType([void])] [CmdletBinding()] param ( diff --git a/src/GitHub/private/Config/Reset-GitHubConfig.ps1 b/src/GitHub/private/Config/Reset-GitHubConfig.ps1 index 54f0933b..5bba90f6 100644 --- a/src/GitHub/private/Config/Reset-GitHubConfig.ps1 +++ b/src/GitHub/private/Config/Reset-GitHubConfig.ps1 @@ -18,7 +18,7 @@ #> [Alias('Reset-GHConfig')] [OutputType([void])] - [CmdletBinding()] + [CmdletBinding(SupportsShouldProcess)] param( # Reset the GitHub configuration for a specific scope. [Parameter()] @@ -58,5 +58,7 @@ } } } - Set-GitHubConfig @Settings + if ($PSCmdlet.ShouldProcess("Module config", "Reset")) { + Set-GitHubConfig @Settings + } } diff --git a/src/GitHub/private/Gitignore/Get-GitHubGitignoreList.ps1 b/src/GitHub/private/Gitignore/Get-GitHubGitignoreList.ps1 index a00a29a2..d4a7e3ab 100644 --- a/src/GitHub/private/Gitignore/Get-GitHubGitignoreList.ps1 +++ b/src/GitHub/private/Gitignore/Get-GitHubGitignoreList.ps1 @@ -4,7 +4,8 @@ filter Get-GitHubGitignoreList { Get all gitignore templates .DESCRIPTION - List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user). + List all templates available to pass as an option when + [creating a repository](https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user). .EXAMPLE Get-GitHubGitignoreList diff --git a/src/GitHub/private/License/Get-GitHubLicenseByName.ps1 b/src/GitHub/private/License/Get-GitHubLicenseByName.ps1 index f8534d8b..77afc3d7 100644 --- a/src/GitHub/private/License/Get-GitHubLicenseByName.ps1 +++ b/src/GitHub/private/License/Get-GitHubLicenseByName.ps1 @@ -16,6 +16,7 @@ filter Get-GitHubLicenseByName { https://docs.github.com/rest/licenses/licenses#get-a-license #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Justification = 'Contains a long link.')] [CmdletBinding()] param ( # The license keyword, license name, or license SPDX ID. For example, mit or mpl-2.0. diff --git a/src/GitHub/private/License/Get-GitHubLicenseList.ps1 b/src/GitHub/private/License/Get-GitHubLicenseList.ps1 index 8086c12e..9caba426 100644 --- a/src/GitHub/private/License/Get-GitHubLicenseList.ps1 +++ b/src/GitHub/private/License/Get-GitHubLicenseList.ps1 @@ -16,6 +16,7 @@ filter Get-GitHubLicenseList { https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Justification = 'Contains a long link.')] [OutputType([string[]])] [CmdletBinding()] param () diff --git a/src/GitHub/private/License/Get-GitHubRepositoryLicense.ps1 b/src/GitHub/private/License/Get-GitHubRepositoryLicense.ps1 index aea2bc04..403c62a8 100644 --- a/src/GitHub/private/License/Get-GitHubRepositoryLicense.ps1 +++ b/src/GitHub/private/License/Get-GitHubRepositoryLicense.ps1 @@ -38,7 +38,7 @@ filter Get-GitHubRepositoryLicense { Invoke-GitHubAPI @inputObject | ForEach-Object { $Response = $_.Response - $rawContent = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Response.content)) + $rawContent = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Response.content)) $Response | Add-Member -NotePropertyName 'raw_content' -NotePropertyValue $rawContent -Force $Response } diff --git a/src/GitHub/private/Organization/Blocking/Block-GitHubUserByOrganization.ps1 b/src/GitHub/private/Organization/Blocking/Block-GitHubUserByOrganization.ps1 index 14ffea29..4097f4bf 100644 --- a/src/GitHub/private/Organization/Blocking/Block-GitHubUserByOrganization.ps1 +++ b/src/GitHub/private/Organization/Blocking/Block-GitHubUserByOrganization.ps1 @@ -4,7 +4,8 @@ Block a user from an organization .DESCRIPTION - Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. + Blocks the given user on behalf of the specified organization and returns a 204. + If the organization cannot block the given user a 422 is returned. .EXAMPLE Block-GitHubUserByOrganization -OrganizationName 'github' -Username 'octocat' diff --git a/src/GitHub/private/Organization/Blocking/Test-GitHubBlockedUserByOrganization.ps1 b/src/GitHub/private/Organization/Blocking/Test-GitHubBlockedUserByOrganization.ps1 index 231a29ea..7f44bdc3 100644 --- a/src/GitHub/private/Organization/Blocking/Test-GitHubBlockedUserByOrganization.ps1 +++ b/src/GitHub/private/Organization/Blocking/Test-GitHubBlockedUserByOrganization.ps1 @@ -4,7 +4,8 @@ Check if a user is blocked by an organization .DESCRIPTION - Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. + Returns a 204 if the given user is blocked by the given organization. + Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. .EXAMPLE Test-GitHubBlockedUserByOrganization -OrganizationName 'PSModule' -Username 'octocat' diff --git a/src/GitHub/private/Organization/Get-GitHubAllOrganization.ps1 b/src/GitHub/private/Organization/Get-GitHubAllOrganization.ps1 index 8461eac5..924b7f4b 100644 --- a/src/GitHub/private/Organization/Get-GitHubAllOrganization.ps1 +++ b/src/GitHub/private/Organization/Get-GitHubAllOrganization.ps1 @@ -6,7 +6,8 @@ .DESCRIPTION Lists all organizations, in the order that they were created on GitHub. - **Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations. + **Note:** Pagination is powered exclusively by the `since` parameter. + Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations. .EXAMPLE Get-GitHubAllOrganization -Since 142951047 @@ -18,6 +19,7 @@ #> [OutputType([pscustomobject])] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Justification = 'Contains a long link.')] [CmdletBinding()] param ( # A organization ID. Only return organizations with an ID greater than this ID. diff --git a/src/GitHub/private/Organization/Get-GitHubMyOrganization.ps1 b/src/GitHub/private/Organization/Get-GitHubMyOrganization.ps1 index 885031b1..353aadda 100644 --- a/src/GitHub/private/Organization/Get-GitHubMyOrganization.ps1 +++ b/src/GitHub/private/Organization/Get-GitHubMyOrganization.ps1 @@ -8,7 +8,11 @@ **OAuth scope requirements** - This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope. OAuth requests with insufficient scope receive a `403 Forbidden` response. + This only lists organizations that your authorization allows you to operate on + in some way (e.g., you can list teams with `read:org` scope, you can publicize your + organization membership with `user` scope, etc.). Therefore, this API requires at + least `user` or `read:org` scope. OAuth requests with insufficient scope receive a + `403 Forbidden` response. .EXAMPLE Get-GitHubMyOrganization diff --git a/src/GitHub/private/Organization/Get-GitHubOrganizationByName.ps1 b/src/GitHub/private/Organization/Get-GitHubOrganizationByName.ps1 index 1e7c140f..9e5517b0 100644 --- a/src/GitHub/private/Organization/Get-GitHubOrganizationByName.ps1 +++ b/src/GitHub/private/Organization/Get-GitHubOrganizationByName.ps1 @@ -4,9 +4,15 @@ Get an organization .DESCRIPTION - To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). - - GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." + To see many of the organization response values, you need to be an authenticated organization + owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, + the organization requires all members, billing managers, and outside collaborators to enable + [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + + GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information + about an organization's GitHub plan. See + "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" + for details. For an example response, see 'Response with GitHub plan information' below." .EXAMPLE Get-GitHubOrganizationByName -OrganizationName 'github' diff --git a/src/GitHub/private/Organization/Get-GitHubUserOrganization.ps1 b/src/GitHub/private/Organization/Get-GitHubUserOrganization.ps1 index 196605a7..068a72ae 100644 --- a/src/GitHub/private/Organization/Get-GitHubUserOrganization.ps1 +++ b/src/GitHub/private/Organization/Get-GitHubUserOrganization.ps1 @@ -4,9 +4,13 @@ List organizations for a user .DESCRIPTION - List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. + List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) + for the specified user. - This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead. + This method only lists _public_ memberships, regardless of authentication. + If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the + [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) + API instead. .EXAMPLE Get-GitHubUserOrganization -Username 'octocat' diff --git a/src/GitHub/private/Releases/Assets/Get-GitHubReleaseAssetByID.ps1 b/src/GitHub/private/Releases/Assets/Get-GitHubReleaseAssetByID.ps1 index 98a405a4..8eae2148 100644 --- a/src/GitHub/private/Releases/Assets/Get-GitHubReleaseAssetByID.ps1 +++ b/src/GitHub/private/Releases/Assets/Get-GitHubReleaseAssetByID.ps1 @@ -4,8 +4,10 @@ Get a release asset .DESCRIPTION - To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/overview/media-types). - The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. + To download the asset's binary content, set the `Accept` header of the request to + [`application/octet-stream`](https://docs.github.com/rest/overview/media-types). + The API will either redirect the client to the location, or stream it directly if + possible. API clients should handle both a `200` or `302` response. .EXAMPLE Get-GitHubReleaseAssetByID -Owner 'octocat' -Repo 'hello-world' -ID '1234567' diff --git a/src/GitHub/private/Repositories/Repositories/Get-GitHubMyRepositories.ps1 b/src/GitHub/private/Repositories/Repositories/Get-GitHubMyRepositories.ps1 index 1ad2c106..257b7199 100644 --- a/src/GitHub/private/Repositories/Repositories/Get-GitHubMyRepositories.ps1 +++ b/src/GitHub/private/Repositories/Repositories/Get-GitHubMyRepositories.ps1 @@ -5,8 +5,8 @@ .DESCRIPTION Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. - The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, - and repositories that they can access through an organization membership. + The authenticated user has explicit permission to access repositories they own, repositories where + they are a collaborator, and repositories that they can access through an organization membership. .EXAMPLE Get-GitHubMyRepositories @@ -19,11 +19,21 @@ Gets the private repositories for the authenticated user. .EXAMPLE - Get-GitHubMyRepositories -Visibility 'public' -Affiliation 'owner','collaborator' -Sort 'created' -Direction 'asc' -PerPage 100 -Since (Get-Date).AddYears(-5) -Before (Get-Date).AddDays(-1) + $param = @{ + Visibility = 'public' + Affiliation = 'owner','collaborator' + Sort = 'created' + Direction = 'asc' + PerPage = 100 + Since = (Get-Date).AddYears(-5) + Before = (Get-Date).AddDays(-1) + } + Get-GitHubMyRepositories @param - Gets the public repositories for the authenticated user that are owned by the authenticated user or that the authenticated user has been added to as a collaborator. - The results are sorted by creation date in ascending order and the results are limited to 100 repositories. - The results are limited to repositories created between 5 years ago and 1 day ago. + Gets the public repositories for the authenticated user that are owned by the authenticated user + or that the authenticated user has been added to as a collaborator. The results are sorted by + creation date in ascending order and the results are limited to 100 repositories. The results + are limited to repositories created between 5 years ago and 1 day ago. .EXAMPLE Get-GitHubMyRepositories -Type 'forks' @@ -45,8 +55,8 @@ #> [CmdletBinding(DefaultParameterSetName = 'Type')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '', Justification = 'Private function, not exposed to user.')] param ( - # Limit results to repositories with the specified visibility. [Parameter( ParameterSetName = 'Aff-Vis' @@ -57,7 +67,8 @@ # Comma-separated list of values. Can include: # - owner: Repositories that are owned by the authenticated user. # - collaborator: Repositories that the user has been added to as a collaborator. - # - organization_member: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. + # - organization_member: Repositories that the user has access to through being a member of an organization. + # This includes every repository on every team that the user is on. # Default: owner, collaborator, organization_member [Parameter( ParameterSetName = 'Aff-Vis' diff --git a/src/GitHub/private/Users/Blocking/Get-GitHubBlockedUserByUser.ps1 b/src/GitHub/private/Users/Blocking/Get-GitHubBlockedUserByUser.ps1 index 6fbad372..35d8a55f 100644 --- a/src/GitHub/private/Users/Blocking/Get-GitHubBlockedUserByUser.ps1 +++ b/src/GitHub/private/Users/Blocking/Get-GitHubBlockedUserByUser.ps1 @@ -26,7 +26,7 @@ $body = $PSBoundParameters | ConvertFrom-HashTable | ConvertTo-HashTable -NameCasingStyle snake_case $inputObject = @{ - APIEndpoint = "/user/blocks" + APIEndpoint = '/user/blocks' Method = 'GET' Body = $body } diff --git a/src/GitHub/private/Users/Blocking/Test-GitHubBlockedUserByUser.ps1 b/src/GitHub/private/Users/Blocking/Test-GitHubBlockedUserByUser.ps1 index 5807f28c..5b7525e3 100644 --- a/src/GitHub/private/Users/Blocking/Test-GitHubBlockedUserByUser.ps1 +++ b/src/GitHub/private/Users/Blocking/Test-GitHubBlockedUserByUser.ps1 @@ -4,7 +4,9 @@ Check if a user is blocked by the authenticated user .DESCRIPTION - Returns a 204 if the given user is blocked by the authenticated user. Returns a 404 if the given user is not blocked by the authenticated user, or if the given user account has been identified as spam by GitHub. + Returns a 204 if the given user is blocked by the authenticated user. + Returns a 404 if the given user is not blocked by the authenticated user, + or if the given user account has been identified as spam by GitHub. .EXAMPLE Test-GitHubBlockedUserByUser -Username 'octocat' diff --git a/src/GitHub/private/Users/Emails/Get-GitHubUserAllEmail.ps1 b/src/GitHub/private/Users/Emails/Get-GitHubUserAllEmail.ps1 index 732f5c38..02709351 100644 --- a/src/GitHub/private/Users/Emails/Get-GitHubUserAllEmail.ps1 +++ b/src/GitHub/private/Users/Emails/Get-GitHubUserAllEmail.ps1 @@ -4,7 +4,8 @@ List email addresses for the authenticated user .DESCRIPTION - Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the `user:email` scope. + Lists all of your email addresses, and specifies which one is visible to the public. + This endpoint is accessible with the `user:email` scope. .EXAMPLE Get-GitHubUserAllEmail @@ -27,7 +28,7 @@ $body = $PSBoundParameters | ConvertFrom-HashTable | ConvertTo-HashTable -NameCasingStyle snake_case $inputObject = @{ - APIEndpoint = "/user/emails" + APIEndpoint = '/user/emails' Method = 'GET' Body = $body } diff --git a/src/GitHub/private/Users/Emails/Get-GitHubUserPublicEmail.ps1 b/src/GitHub/private/Users/Emails/Get-GitHubUserPublicEmail.ps1 index b81229be..26fa21c2 100644 --- a/src/GitHub/private/Users/Emails/Get-GitHubUserPublicEmail.ps1 +++ b/src/GitHub/private/Users/Emails/Get-GitHubUserPublicEmail.ps1 @@ -4,7 +4,9 @@ List public email addresses for the authenticated user .DESCRIPTION - Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the `user:email` scope. + Lists your publicly visible email address, which you can set with the + [Set primary email visibility for the authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user) + endpoint. This endpoint is accessible with the `user:email` scope. .EXAMPLE Get-GitHubUserPublicEmail @@ -16,6 +18,7 @@ #> [OutputType([pscustomobject])] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Justification = 'Link to documentation.')] [CmdletBinding()] param ( # The number of results per page (max 100). @@ -27,7 +30,7 @@ $body = $PSBoundParameters | ConvertFrom-HashTable | ConvertTo-HashTable -NameCasingStyle snake_case $inputObject = @{ - APIEndpoint = "/user/public_emails" + APIEndpoint = '/user/public_emails' Method = 'GET' Body = $body } diff --git a/src/GitHub/private/Users/Followers/Get-GitHubUserMyFollowers.ps1 b/src/GitHub/private/Users/Followers/Get-GitHubUserMyFollowers.ps1 index ec066897..9edf72d6 100644 --- a/src/GitHub/private/Users/Followers/Get-GitHubUserMyFollowers.ps1 +++ b/src/GitHub/private/Users/Followers/Get-GitHubUserMyFollowers.ps1 @@ -16,6 +16,7 @@ #> [OutputType([pscustomobject])] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '', Justification = 'Private function, not exposed to user.')] [CmdletBinding()] param ( # The number of results per page (max 100). diff --git a/src/GitHub/private/Users/GPG-Keys/Get-GitHubUserMyGpgKey.ps1 b/src/GitHub/private/Users/GPG-Keys/Get-GitHubUserMyGpgKey.ps1 index ba53b242..1d41bec4 100644 --- a/src/GitHub/private/Users/GPG-Keys/Get-GitHubUserMyGpgKey.ps1 +++ b/src/GitHub/private/Users/GPG-Keys/Get-GitHubUserMyGpgKey.ps1 @@ -5,7 +5,8 @@ .DESCRIPTION Lists the current user's GPG keys. - Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` + [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE Get-GitHubUserMyGpgKey diff --git a/src/GitHub/private/Users/GPG-Keys/Get-GitHubUserMyGpgKeyById.ps1 b/src/GitHub/private/Users/GPG-Keys/Get-GitHubUserMyGpgKeyById.ps1 index 37970f68..1e6b5f87 100644 --- a/src/GitHub/private/Users/GPG-Keys/Get-GitHubUserMyGpgKeyById.ps1 +++ b/src/GitHub/private/Users/GPG-Keys/Get-GitHubUserMyGpgKeyById.ps1 @@ -5,7 +5,8 @@ .DESCRIPTION View extended details for a single GPG key. - Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` + [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE Get-GitHubUserMyGpgKeyById -ID '1234567' diff --git a/src/GitHub/private/Users/Keys/Get-GitHubUserMyKey.ps1 b/src/GitHub/private/Users/Keys/Get-GitHubUserMyKey.ps1 index f1a79153..711d125c 100644 --- a/src/GitHub/private/Users/Keys/Get-GitHubUserMyKey.ps1 +++ b/src/GitHub/private/Users/Keys/Get-GitHubUserMyKey.ps1 @@ -5,7 +5,8 @@ .DESCRIPTION Lists the public SSH keys for the authenticated user's GitHub account. - Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` + [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE Get-GitHubUserMyKey diff --git a/src/GitHub/private/Users/Keys/Get-GitHubUserMyKeyById.ps1 b/src/GitHub/private/Users/Keys/Get-GitHubUserMyKeyById.ps1 index a3728756..79309855 100644 --- a/src/GitHub/private/Users/Keys/Get-GitHubUserMyKeyById.ps1 +++ b/src/GitHub/private/Users/Keys/Get-GitHubUserMyKeyById.ps1 @@ -5,7 +5,8 @@ .DESCRIPTION View extended details for a single public SSH key. - Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` + [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE Get-GitHubUserMyKeyById -ID '1234567' diff --git a/src/GitHub/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKey.ps1 b/src/GitHub/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKey.ps1 index a406934d..df562ad1 100644 --- a/src/GitHub/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKey.ps1 +++ b/src/GitHub/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKey.ps1 @@ -4,8 +4,9 @@ List SSH signing keys for the authenticated user .DESCRIPTION - Lists the SSH signing keys for the authenticated user's GitHub account. - You must authenticate with Basic Authentication, or you must authenticate with OAuth with at least `read:ssh_signing_key` scope. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." + Lists the SSH signing keys for the authenticated user's GitHub account. You must authenticate with + Basic Authentication, or you must authenticate with OAuth with at least `read:ssh_signing_key` scope. For more information, see + "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." .EXAMPLE Get-GitHubUserMySigningKey diff --git a/src/GitHub/private/Users/Social-Accounts/Get-GitHubMyUserSocials.ps1 b/src/GitHub/private/Users/Social-Accounts/Get-GitHubMyUserSocials.ps1 index 0d229fc3..717ec15f 100644 --- a/src/GitHub/private/Users/Social-Accounts/Get-GitHubMyUserSocials.ps1 +++ b/src/GitHub/private/Users/Social-Accounts/Get-GitHubMyUserSocials.ps1 @@ -15,6 +15,7 @@ https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user #> [OutputType([pscustomobject])] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '', Justification = 'Private function, not exposed to user.')] [CmdletBinding()] param ( # The number of results per page (max 100). diff --git a/src/GitHub/public/API/Invoke-GitHubAPI.ps1 b/src/GitHub/public/API/Invoke-GitHubAPI.ps1 index 49d2d521..35f0c816 100644 --- a/src/GitHub/public/API/Invoke-GitHubAPI.ps1 +++ b/src/GitHub/public/API/Invoke-GitHubAPI.ps1 @@ -90,8 +90,6 @@ $AccessToken = (Get-GitHubConfig -Name AccessToken) } - $functionName = $MyInvocation.MyCommand.Name - $headers = @{ Accept = $Accept 'X-GitHub-Api-Version' = $Version @@ -158,10 +156,10 @@ Write-Verbose '----------------------------------' Write-Verbose "StatusCode: $statusCode" Write-Verbose '----------------------------------' - Write-Verbose "Request:" + Write-Verbose 'Request:' $APICall | ConvertFrom-HashTable | Format-List | Out-String -Stream | Write-Verbose Write-Verbose '----------------------------------' - Write-Verbose "ResponseHeaders:" + Write-Verbose 'ResponseHeaders:' $responseHeaders | Format-List | Out-String -Stream | Write-Verbose Write-Verbose '----------------------------------' @@ -173,13 +171,13 @@ } } } catch { - Write-Error "Request:" + Write-Error 'Request:' $APICall | ConvertFrom-HashTable | Format-List | Out-String -Stream | Write-Error - Write-Error "Message:" + Write-Error 'Message:' $_.Exception.Message | ConvertFrom-HashTable | Format-List | Out-String -Stream | Write-Error - Write-Error "Response:" + Write-Error 'Response:' $_.Exception.Response | ConvertFrom-HashTable | Format-List | Out-String -Stream | Write-Error throw $errorMessage } diff --git a/tools/utilities/GitHubAPI.ps1 b/tools/utilities/GitHubAPI.ps1 index 272bfa51..70f95bc4 100644 --- a/tools/utilities/GitHubAPI.ps1 +++ b/tools/utilities/GitHubAPI.ps1 @@ -42,11 +42,11 @@ $response.paths.$path.$method.responses.'200'.content.'application/json'.schema. $response.components.schemas.PSobject.Properties | ForEach-Object { [pscustomobject]@{ - Name = $_.Name - Title = $_.Value.title - Type = $_.Value.type + Name = $_.Name + Title = $_.Value.title + Type = $_.Value.type Properties = $_.Value.properties - Required = $_.Value.required + Required = $_.Value.required } }