diff --git a/.github/PSModule.yml b/.github/PSModule.yml index 9a91761c3..0d130b7e0 100644 --- a/.github/PSModule.yml +++ b/.github/PSModule.yml @@ -19,3 +19,14 @@ Test: # Build: # Docs: # Skip: true + +Linter: + env: + VALIDATE_BIOME_FORMAT: false + VALIDATE_BIOME_LINT: false + VALIDATE_GITHUB_ACTIONS_ZIZMOR: false + VALIDATE_JSCPD: false + VALIDATE_JSON_PRETTIER: false + VALIDATE_MARKDOWN_PRETTIER: false + VALIDATE_YAML_PRETTIER: false + VALIDATE_POWERSHELL: false diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index 5b21b4a03..57db57e64 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -8,19 +8,19 @@ ############### # Rules by id # ############### -MD004: false # Unordered list style +MD004: false # Unordered list style MD007: - indent: 2 # Unordered list indentation + indent: 2 # Unordered list indentation MD013: - line_length: 808 # Line length -MD024: false # no-duplicate-heading, INPUTS and OUTPUTS _can_ be the same item + line_length: 808 # Line length +MD024: false # no-duplicate-heading, INPUTS and OUTPUTS _can_ be the same item MD026: - punctuation: ".,;:!。,;:" # List of not allowed -MD029: false # Ordered list item prefix -MD033: false # Allow inline HTML -MD036: false # Emphasis used instead of a heading + punctuation: '.,;:!。,;:' # List of not allowed +MD029: false # Ordered list item prefix +MD033: false # Allow inline HTML +MD036: false # Emphasis used instead of a heading ################# # Rules by tags # ################# -blank_lines: false # Error on blank lines +blank_lines: false # Error on blank lines diff --git a/src/classes/public/GitHubPermission.ps1 b/src/classes/public/GitHubPermission.ps1 index 3a0d6d9ce..c3f07529d 100644 --- a/src/classes/public/GitHubPermission.ps1 +++ b/src/classes/public/GitHubPermission.ps1 @@ -1,4 +1,4 @@ -class GitHubPermission : System.IEquatable[Object] { +class GitHubPermission : System.IEquatable[Object] { # The programmatic name of the permission as returned by the GitHub API [string] $Name diff --git a/src/functions/private/Actions/Import-GitHubEventData.ps1 b/src/functions/private/Actions/Import-GitHubEventData.ps1 index fa5cf33de..bc69151a2 100644 --- a/src/functions/private/Actions/Import-GitHubEventData.ps1 +++ b/src/functions/private/Actions/Import-GitHubEventData.ps1 @@ -9,7 +9,9 @@ function Import-GitHubEventData { Import data from the event that triggered the workflow. .EXAMPLE + ```powershell Import-GitHubEventData + ``` #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSUseShouldProcessForStateChangingFunctions', '', diff --git a/src/functions/private/Actions/Import-GitHubRunnerData.ps1 b/src/functions/private/Actions/Import-GitHubRunnerData.ps1 index 3a8ae9542..cdef313cd 100644 --- a/src/functions/private/Actions/Import-GitHubRunnerData.ps1 +++ b/src/functions/private/Actions/Import-GitHubRunnerData.ps1 @@ -7,7 +7,9 @@ Import data about the runner that is running the workflow. .EXAMPLE + ```powershell Import-GitHubRunnerData + ``` #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSUseShouldProcessForStateChangingFunctions', '', diff --git a/src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByRepo.ps1 b/src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByRepo.ps1 index 9f756123c..c381f7d03 100644 --- a/src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByRepo.ps1 +++ b/src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByRepo.ps1 @@ -12,12 +12,16 @@ `created`, `event`, `head_sha`, `status`. .EXAMPLE + ```powershell Get-GitHubWorkflowRunByRepo -Owner 'owner' -Repository 'repo' + ``` Lists all workflow runs for a repository. .EXAMPLE + ```powershell Get-GitHubWorkflowRunByRepo -Owner 'owner' -Repository 'repo' -Actor 'octocat' -Branch 'main' -Event 'push' -Status 'success' + ``` Lists all workflow runs for a repository with the specified actor, branch, event, and status. diff --git a/src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByWorkflow.ps1 b/src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByWorkflow.ps1 index 918fd069d..695b84037 100644 --- a/src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByWorkflow.ps1 +++ b/src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByWorkflow.ps1 @@ -13,12 +13,16 @@ `created`, `event`, `head_sha`, `status`. .EXAMPLE + ```powershell Get-GitHubWorkflowRunByWorkflow -Owner 'octocat' -Repository 'Hello-World' -ID '42' + ``` Gets all workflow runs for the workflow with the ID `42` in the repository `Hello-World` owned by `octocat`. .EXAMPLE + ```powershell Get-GitHubWorkflowRunByWorkflow -Owner 'octocat' -Repository 'Hello-World' -ID '42' -Actor 'octocat' -Branch 'main' -Event 'push' -Status 'success' + ``` Gets all workflow runs for the workflow with the ID `42` in the repository `Hello-World` owned by `octocat` that were triggered by the user `octocat` on the branch `main` and have the status `success`. diff --git a/src/functions/private/Apps/GitHub Apps/Add-GitHubKeyVaultJWTSignature.ps1 b/src/functions/private/Apps/GitHub Apps/Add-GitHubKeyVaultJWTSignature.ps1 index 1665a309c..f64da3c11 100644 --- a/src/functions/private/Apps/GitHub Apps/Add-GitHubKeyVaultJWTSignature.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Add-GitHubKeyVaultJWTSignature.ps1 @@ -8,7 +8,9 @@ The function supports authentication via Azure CLI or Az PowerShell module and returns the signed JWT as a secure string. .EXAMPLE + ```powershell Add-GitHubKeyVaultJWTSignature -UnsignedJWT 'header.payload' -KeyVaultKeyReference 'https://myvault.vault.azure.net/keys/mykey' + ``` Output: ```powershell diff --git a/src/functions/private/Apps/GitHub Apps/Add-GitHubLocalJWTSignature.ps1 b/src/functions/private/Apps/GitHub Apps/Add-GitHubLocalJWTSignature.ps1 index 1c14e89f3..9c35e3940 100644 --- a/src/functions/private/Apps/GitHub Apps/Add-GitHubLocalJWTSignature.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Add-GitHubLocalJWTSignature.ps1 @@ -8,7 +8,9 @@ This function handles the RSA signing process and returns the complete signed JWT. .EXAMPLE + ```powershell Add-GitHubLocalJWTSignature -UnsignedJWT 'eyJ0eXAiOi...' -PrivateKey '--- BEGIN RSA PRIVATE KEY --- ... --- END RSA PRIVATE KEY ---' + ``` Adds a signature to the unsigned JWT using the provided private key. diff --git a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppAsAuthenticatedApp.ps1 b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppAsAuthenticatedApp.ps1 index b5383bc2c..fe324e64a 100644 --- a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppAsAuthenticatedApp.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppAsAuthenticatedApp.ps1 @@ -13,7 +13,9 @@ to access this endpoint. .EXAMPLE + ```powershell Get-GitHubAppAsAuthenticatedApp + ``` Get the authenticated app. diff --git a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppBySlug.ps1 b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppBySlug.ps1 index ce921c706..b226065e1 100644 --- a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppBySlug.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppBySlug.ps1 @@ -7,7 +7,9 @@ Gets a single GitHub App using the app's slug. .EXAMPLE + ```powershell Get-GitHubAppByName -AppSlug 'github-actions' + ``` Gets the GitHub App with the slug 'github-actions'. diff --git a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallableOrganization.ps1 b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallableOrganization.ps1 index 06e229ebd..6c99184e6 100644 --- a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallableOrganization.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallableOrganization.ps1 @@ -11,7 +11,9 @@ - enterprise_organization_installations: read .EXAMPLE + ```powershell Get-GitHubAppInstallableOrganization -Enterprise 'msx' + ``` .OUTPUTS GitHubOrganization[] diff --git a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedAppAsList.ps1 b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedAppAsList.ps1 index 49bf28609..b7e0b10a8 100644 --- a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedAppAsList.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedAppAsList.ps1 @@ -10,7 +10,9 @@ to access this endpoint. .EXAMPLE + ```powershell Get-GitHubAppInstallationForAuthenticatedAppAsList + ``` List installations for the authenticated app. diff --git a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedAppByID.ps1 b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedAppByID.ps1 index 0c16a017b..e114658d2 100644 --- a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedAppByID.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForAuthenticatedAppByID.ps1 @@ -10,7 +10,9 @@ to access this endpoint. .EXAMPLE + ```powershell Get-GitHubAppInstallationForAuthenticatedAppByID -ID 123456 + ``` Get an installation for the authenticated app with the specified ID. diff --git a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForEnterpriseOrganization.ps1 b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForEnterpriseOrganization.ps1 index 208c6d4c7..885a351ac 100644 --- a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForEnterpriseOrganization.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForEnterpriseOrganization.ps1 @@ -9,7 +9,9 @@ The authenticated GitHub App must be installed on the enterprise and be granted the Enterprise/organization_installations (read) permission. .EXAMPLE + ```powershell Get-GitHubAppInstallationForEnterpriseOrganization -Enterprise 'msx' -Organization 'github' + ``` Gets all GitHub Apps in the organization `github` in the enterprise `msx`. diff --git a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForOrganization.ps1 b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForOrganization.ps1 index f53d15106..f3ae0e5d3 100644 --- a/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForOrganization.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Get-GitHubAppInstallationForOrganization.ps1 @@ -8,7 +8,9 @@ You must be an organization owner with `admin:read` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubAppInstallationForOrganization -Organization 'github' + ``` Gets all GitHub Apps in the organization `github`. diff --git a/src/functions/private/Apps/GitHub Apps/Install-GitHubAppOnEnterpriseOrganization.ps1 b/src/functions/private/Apps/GitHub Apps/Install-GitHubAppOnEnterpriseOrganization.ps1 index d417c0628..3186ecdde 100644 --- a/src/functions/private/Apps/GitHub Apps/Install-GitHubAppOnEnterpriseOrganization.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Install-GitHubAppOnEnterpriseOrganization.ps1 @@ -9,7 +9,9 @@ The authenticated GitHub App must be installed on the enterprise and be granted the Enterprise/organization_installations (write) permission. .EXAMPLE + ```powershell Install-GitHubAppOnEnterpriseOrganization -Enterprise 'msx' -Organization 'org' -ClientID '123456' + ``` #> [OutputType([GitHubAppInstallation])] [CmdletBinding()] diff --git a/src/functions/private/Apps/GitHub Apps/New-GitHubUnsignedJWT.ps1 b/src/functions/private/Apps/GitHub Apps/New-GitHubUnsignedJWT.ps1 index 16d3264cc..c61f6b6bf 100644 --- a/src/functions/private/Apps/GitHub Apps/New-GitHubUnsignedJWT.ps1 +++ b/src/functions/private/Apps/GitHub Apps/New-GitHubUnsignedJWT.ps1 @@ -9,7 +9,9 @@ that can be passed to a signing function. .EXAMPLE + ```powershell New-GitHubUnsignedJWT -ClientId 'Iv987654321' + ``` Creates an unsigned JWT for a GitHub App using the specified client ID. diff --git a/src/functions/private/Apps/GitHub Apps/Test-GitHubJWTRefreshRequired.ps1 b/src/functions/private/Apps/GitHub Apps/Test-GitHubJWTRefreshRequired.ps1 index 4db614e1f..72356fc0c 100644 --- a/src/functions/private/Apps/GitHub Apps/Test-GitHubJWTRefreshRequired.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Test-GitHubJWTRefreshRequired.ps1 @@ -1,4 +1,4 @@ -function Test-GitHubJWTRefreshRequired { +function Test-GitHubJWTRefreshRequired { <# .SYNOPSIS Test if the GitHub JWT should be refreshed. @@ -7,7 +7,9 @@ function Test-GitHubJWTRefreshRequired { Test if the GitHub JWT should be refreshed. JWTs are refreshed when they have 150 seconds or less remaining before expiration. .EXAMPLE + ```powershell Test-GitHubJWTRefreshRequired -Context $Context + ``` This will test if the GitHub JWT should be refreshed for the specified context. diff --git a/src/functions/private/Apps/GitHub Apps/Uninstall-GitHubAppAsApp.ps1 b/src/functions/private/Apps/GitHub Apps/Uninstall-GitHubAppAsApp.ps1 index 2b6defff8..a71ac7569 100644 --- a/src/functions/private/Apps/GitHub Apps/Uninstall-GitHubAppAsApp.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Uninstall-GitHubAppAsApp.ps1 @@ -1,4 +1,4 @@ -function Uninstall-GitHubAppAsApp { +function Uninstall-GitHubAppAsApp { <# .SYNOPSIS Delete an installation for the authenticated app. @@ -7,7 +7,9 @@ function Uninstall-GitHubAppAsApp { Deletes a GitHub App installation using the authenticated App context. .EXAMPLE + ```powershell Uninstall-GitHubAppAsApp -ID 123456 -Context $appContext + ``` Deletes the installation with ID 123456 for the authenticated app. diff --git a/src/functions/private/Apps/GitHub Apps/Uninstall-GitHubAppOnEnterpriseOrganization.ps1 b/src/functions/private/Apps/GitHub Apps/Uninstall-GitHubAppOnEnterpriseOrganization.ps1 index 60dab447f..19e50b795 100644 --- a/src/functions/private/Apps/GitHub Apps/Uninstall-GitHubAppOnEnterpriseOrganization.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Uninstall-GitHubAppOnEnterpriseOrganization.ps1 @@ -9,7 +9,9 @@ The authenticated GitHub App must be installed on the enterprise and be granted the Enterprise/organization_installations (write) permission. .EXAMPLE + ```powershell Uninstall-GitHubAppOnEnterpriseOrganization -Enterprise 'github' -Organization 'octokit' -ID '123456' + ``` Uninstall the GitHub App with the installation ID `123456` from the organization `octokit` in the enterprise `github`. diff --git a/src/functions/private/Apps/GitHub Apps/Update-GitHubAppJWT.ps1 b/src/functions/private/Apps/GitHub Apps/Update-GitHubAppJWT.ps1 index e9f6892e4..7fff17ed9 100644 --- a/src/functions/private/Apps/GitHub Apps/Update-GitHubAppJWT.ps1 +++ b/src/functions/private/Apps/GitHub Apps/Update-GitHubAppJWT.ps1 @@ -8,17 +8,23 @@ it will be refreshed. This function implements mutex-based locking to prevent concurrent refreshes. .EXAMPLE + ```powershell Update-GitHubAppJWT -Context $Context + ``` Updates the JSON Web Token (JWT) for a GitHub App using the specified context. .EXAMPLE + ```powershell Update-GitHubAppJWT -Context $Context -PassThru + ``` This will update the GitHub App JWT for the specified context and return the updated context. .EXAMPLE + ```powershell Update-GitHubAppJWT -Context $Context -Silent + ``` This will update the GitHub App JWT for the specified context without displaying progress messages. diff --git a/src/functions/private/Artifacts/Get-GitHubArtifactById.ps1 b/src/functions/private/Artifacts/Get-GitHubArtifactById.ps1 index 0c0c911b0..5dff1e189 100644 --- a/src/functions/private/Artifacts/Get-GitHubArtifactById.ps1 +++ b/src/functions/private/Artifacts/Get-GitHubArtifactById.ps1 @@ -9,7 +9,9 @@ The function returns a custom GitHubArtifact object containing metadata and download information for the artifact. .EXAMPLE + ```powershell Get-GitHubArtifactById -Owner 'octocat' -Repository 'hello-world' -ID '123456' + ``` Output: ```powershell diff --git a/src/functions/private/Artifacts/Get-GitHubArtifactFromRepository.ps1 b/src/functions/private/Artifacts/Get-GitHubArtifactFromRepository.ps1 index 8b12374ce..a74e04802 100644 --- a/src/functions/private/Artifacts/Get-GitHubArtifactFromRepository.ps1 +++ b/src/functions/private/Artifacts/Get-GitHubArtifactFromRepository.ps1 @@ -10,7 +10,9 @@ By default, only the latest version of each artifact is returned unless -AllVersions is specified. .EXAMPLE + ```powershell Get-GitHubArtifactFromRepository -Owner 'octocat' -Repository 'demo-repo' -AllVersions + ``` Output: ```powershell diff --git a/src/functions/private/Artifacts/Get-GitHubArtifactFromWorkflowRun.ps1 b/src/functions/private/Artifacts/Get-GitHubArtifactFromWorkflowRun.ps1 index 07b2c9522..4d9526ca8 100644 --- a/src/functions/private/Artifacts/Get-GitHubArtifactFromWorkflowRun.ps1 +++ b/src/functions/private/Artifacts/Get-GitHubArtifactFromWorkflowRun.ps1 @@ -9,7 +9,9 @@ The function can optionally filter artifacts by name or return only the latest version per artifact name. .EXAMPLE + ```powershell Get-GitHubArtifactFromWorkflowRun -Owner 'octocat' -Repository 'demo' -ID '123456789' + ``` Output: ```powershell diff --git a/src/functions/private/Auth/Cli/Connect-GithubCli.ps1 b/src/functions/private/Auth/Cli/Connect-GithubCli.ps1 index dd77bdf7d..c8fd25a2b 100644 --- a/src/functions/private/Auth/Cli/Connect-GithubCli.ps1 +++ b/src/functions/private/Auth/Cli/Connect-GithubCli.ps1 @@ -9,8 +9,10 @@ If authentication fails, a warning is displayed, and `LASTEXITCODE` is reset to `0`. .EXAMPLE + ```powershell $context = Connect-GitHubAccount $context | Connect-GitHubCli + ``` Output: ```powershell diff --git a/src/functions/private/Auth/Context/Assert-GitHubContext.ps1 b/src/functions/private/Auth/Context/Assert-GitHubContext.ps1 index 60538b622..f0936fa4a 100644 --- a/src/functions/private/Auth/Context/Assert-GitHubContext.ps1 +++ b/src/functions/private/Auth/Context/Assert-GitHubContext.ps1 @@ -8,7 +8,9 @@ If the context does not meet the requirements, an error is thrown. .EXAMPLE + ```powershell Assert-GitHubContext -Context 'github.com/Octocat' -AuthType 'App' + ``` #> [OutputType([void])] [CmdletBinding()] diff --git a/src/functions/private/Auth/Context/Remove-GitHubContext.ps1 b/src/functions/private/Auth/Context/Remove-GitHubContext.ps1 index 6d2b97dbd..987696931 100644 --- a/src/functions/private/Auth/Context/Remove-GitHubContext.ps1 +++ b/src/functions/private/Auth/Context/Remove-GitHubContext.ps1 @@ -9,12 +9,16 @@ If the specified context(s) exist, they will be removed from the vault. .EXAMPLE + ```powershell Remove-Context + ``` Removes all contexts from the vault. .EXAMPLE + ```powershell Remove-Context -ID 'MyContext' + ``` Removes the context called 'MyContext' from the vault. #> diff --git a/src/functions/private/Auth/Context/Resolve-GitHubContext.ps1 b/src/functions/private/Auth/Context/Resolve-GitHubContext.ps1 index a28e871a6..c1a942f6f 100644 --- a/src/functions/private/Auth/Context/Resolve-GitHubContext.ps1 +++ b/src/functions/private/Auth/Context/Resolve-GitHubContext.ps1 @@ -11,12 +11,16 @@ If the context is a App, it will look at the available contexts and return the one that matches the scope of the command being run. .EXAMPLE + ```powershell $Context = Resolve-GitHubContext -Context 'github.com/Octocat' + ``` This will resolve the context 'github.com/Octocat' into a GitHubContext object. .EXAMPLE + ```powershell $Context = Resolve-GitHubContext -Context $GitHubContext + ``` This will return the GitHubContext object. #> diff --git a/src/functions/private/Auth/Context/Resolve-GitHubContextSetting.ps1 b/src/functions/private/Auth/Context/Resolve-GitHubContextSetting.ps1 index b152c6e96..43380607a 100644 --- a/src/functions/private/Auth/Context/Resolve-GitHubContextSetting.ps1 +++ b/src/functions/private/Auth/Context/Resolve-GitHubContextSetting.ps1 @@ -9,7 +9,9 @@ it will return the default value from the GitHub configuration. This is useful for resolving API-related settings dynamically. .EXAMPLE + ```powershell Resolve-GitHubContextSetting -Name 'Repository' -Value 'MyRepo' + ``` Output: ```powershell @@ -19,7 +21,9 @@ Returns the provided value 'MyRepo' for the 'Repository' setting. .EXAMPLE + ```powershell Resolve-GitHubContextSetting -Name 'Repository' -Context $GitHubContext + ``` Output: ```powershell @@ -29,7 +33,9 @@ Retrieves the 'Repository' setting from the provided GitHub context object. .EXAMPLE + ```powershell Resolve-GitHubContextSetting -Name 'ApiBaseUrl' + ``` Output: ```powershell diff --git a/src/functions/private/Auth/Context/Set-GitHubContext.ps1 b/src/functions/private/Auth/Context/Set-GitHubContext.ps1 index ee39cdadf..116d27fd2 100644 --- a/src/functions/private/Auth/Context/Set-GitHubContext.ps1 +++ b/src/functions/private/Auth/Context/Set-GitHubContext.ps1 @@ -8,6 +8,7 @@ The context is used to authenticate with the GitHub API. .EXAMPLE + ```powershell $context = @{ ApiBaseUri = 'https://api.github.com' ApiVersion = '2022-11-28' @@ -18,6 +19,7 @@ Repository = 'Hello-World' } Set-GitHubContext -Context $context + ``` Sets the GitHub context with the specified settings as a hashtable. #> diff --git a/src/functions/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 b/src/functions/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 index 32afe8622..3afa9fcda 100644 --- a/src/functions/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 +++ b/src/functions/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 @@ -7,7 +7,9 @@ Starts the GitHub Device Flow login process. This will prompt the user to visit a URL and enter a code. .EXAMPLE + ```powershell Invoke-GitHubDeviceFlowLogin + ``` This will start the GitHub Device Flow login process. The user gets prompted to visit a URL and enter a code. diff --git a/src/functions/private/Auth/DeviceFlow/Request-GitHubAccessToken.ps1 b/src/functions/private/Auth/DeviceFlow/Request-GitHubAccessToken.ps1 index ed32bc697..5d7667e12 100644 --- a/src/functions/private/Auth/DeviceFlow/Request-GitHubAccessToken.ps1 +++ b/src/functions/private/Auth/DeviceFlow/Request-GitHubAccessToken.ps1 @@ -8,7 +8,9 @@ This will poll the GitHub API until the user has entered the code. .EXAMPLE + ```powershell Request-GitHubAccessToken -DeviceCode $deviceCode -ClientID $ClientID -HostName 'github.com' + ``` This will poll the GitHub API until the user has entered the code. diff --git a/src/functions/private/Auth/DeviceFlow/Request-GitHubDeviceCode.ps1 b/src/functions/private/Auth/DeviceFlow/Request-GitHubDeviceCode.ps1 index 9341aedec..44ce973b5 100644 --- a/src/functions/private/Auth/DeviceFlow/Request-GitHubDeviceCode.ps1 +++ b/src/functions/private/Auth/DeviceFlow/Request-GitHubDeviceCode.ps1 @@ -7,7 +7,9 @@ Request a GitHub Device Code. .EXAMPLE + ```powershell Request-GitHubDeviceCode -ClientID $ClientID -Mode $Mode -HostName 'github.com' + ``` This will request a GitHub Device Code. diff --git a/src/functions/private/Auth/DeviceFlow/Test-GitHubAccessTokenRefreshRequired.ps1 b/src/functions/private/Auth/DeviceFlow/Test-GitHubAccessTokenRefreshRequired.ps1 index 292ded46a..ab0706847 100644 --- a/src/functions/private/Auth/DeviceFlow/Test-GitHubAccessTokenRefreshRequired.ps1 +++ b/src/functions/private/Auth/DeviceFlow/Test-GitHubAccessTokenRefreshRequired.ps1 @@ -7,7 +7,9 @@ Test if the GitHub access token should be refreshed. .EXAMPLE + ```powershell Test-GitHubAccessTokenRefreshRequired + ``` This will test if the GitHub access token should be refreshed. #> diff --git a/src/functions/private/Auth/DeviceFlow/Update-GitHubUserAccessToken.ps1 b/src/functions/private/Auth/DeviceFlow/Update-GitHubUserAccessToken.ps1 index ab5183e7e..d3760379f 100644 --- a/src/functions/private/Auth/DeviceFlow/Update-GitHubUserAccessToken.ps1 +++ b/src/functions/private/Auth/DeviceFlow/Update-GitHubUserAccessToken.ps1 @@ -7,12 +7,16 @@ Updates the GitHub access token. If the access token is still valid, it will not be refreshed. .EXAMPLE + ```powershell Update-GitHubUserAccessToken + ``` This will update the GitHub access token for the default context. .EXAMPLE + ```powershell Update-GitHubUserAccessToken -Context 'github.com/mojombo' + ``` This will update the GitHub access token for the context 'github.com/mojombo'. diff --git a/src/functions/private/Auth/DeviceFlow/Wait-GitHubAccessToken.ps1 b/src/functions/private/Auth/DeviceFlow/Wait-GitHubAccessToken.ps1 index 6d1c65924..9896f4976 100644 --- a/src/functions/private/Auth/DeviceFlow/Wait-GitHubAccessToken.ps1 +++ b/src/functions/private/Auth/DeviceFlow/Wait-GitHubAccessToken.ps1 @@ -8,12 +8,16 @@ This will poll the GitHub API until the user has entered the code. .EXAMPLE + ```powershell Wait-GitHubAccessToken -DeviceCode $deviceCode -ClientID $ClientID -Interval $interval + ``` This will poll the GitHub API until the user has entered the code. .EXAMPLE + ```powershell Wait-GitHubAccessToken -Refresh -ClientID $ClientID + ``` .NOTES For more info about the Device Flow visit: diff --git a/src/functions/private/Auth/Get-GitHubToken.ps1 b/src/functions/private/Auth/Get-GitHubToken.ps1 index 491350e39..a33037d46 100644 --- a/src/functions/private/Auth/Get-GitHubToken.ps1 +++ b/src/functions/private/Auth/Get-GitHubToken.ps1 @@ -10,7 +10,9 @@ either a raw token value or a secure version for sensitive operations. .EXAMPLE + ```powershell Get-GitHubToken + ``` Output: ```powershell @@ -20,7 +22,9 @@ Returns the GitHub token as a secure string for safer handling in scripts or automation. .EXAMPLE + ```powershell Get-GitHubToken -AsPlainText + ``` Output: ```powershell diff --git a/src/functions/private/Auth/Test-GitHubToken.ps1 b/src/functions/private/Auth/Test-GitHubToken.ps1 index 28a9c29d8..633338e1e 100644 --- a/src/functions/private/Auth/Test-GitHubToken.ps1 +++ b/src/functions/private/Auth/Test-GitHubToken.ps1 @@ -7,7 +7,9 @@ This function checks if the GitHub token is available in the environment variables. .EXAMPLE + ```powershell Test-GitHubToken + ``` #> [OutputType([bool])] [CmdletBinding()] diff --git a/src/functions/private/Branches/Get-GitHubBranchList.ps1 b/src/functions/private/Branches/Get-GitHubBranchList.ps1 index f68175b86..e2fd4016e 100644 --- a/src/functions/private/Branches/Get-GitHubBranchList.ps1 +++ b/src/functions/private/Branches/Get-GitHubBranchList.ps1 @@ -7,7 +7,9 @@ Lists all branches from a repository .EXAMPLE + ```powershell Get-GitHubBranchList -Owner 'octocat' -Repository 'Hello-World' + ``` Gets all the branches from the 'Hello-World' repository owned by 'octocat' diff --git a/src/functions/private/Commands/ConvertFrom-GitHubOutput.ps1 b/src/functions/private/Commands/ConvertFrom-GitHubOutput.ps1 index bea418f38..a4038a3a0 100644 --- a/src/functions/private/Commands/ConvertFrom-GitHubOutput.ps1 +++ b/src/functions/private/Commands/ConvertFrom-GitHubOutput.ps1 @@ -8,6 +8,7 @@ supporting both single-line and multi-line values, and parsing JSON values. .EXAMPLE + ```powershell $content = @' zen=something else result={"MyOutput":"Hello, World!","Status":"Success"} @@ -21,7 +22,12 @@ '@ ConvertFrom-GitHubOutput -OutputContent $content + ``` + This will convert the GitHub Actions output syntax to a PowerShell object. + + Output: + ```powershell zen : something else result : @{MyOutput=Hello, World!; Status=Success} MY_VALUE : Line1 @@ -29,8 +35,7 @@ Line3 Config : {[Nested, System.Collections.Hashtable], [Setting1, Value1], [Setting2, 2]} Numbers : 12345 - - This will convert the GitHub Actions output syntax to a PowerShell object. + ``` #> [OutputType([pscustomobject])] diff --git a/src/functions/private/Config/Initialize-GitHubConfig.ps1 b/src/functions/private/Config/Initialize-GitHubConfig.ps1 index c8d733fa4..bbd55338b 100644 --- a/src/functions/private/Config/Initialize-GitHubConfig.ps1 +++ b/src/functions/private/Config/Initialize-GitHubConfig.ps1 @@ -7,12 +7,16 @@ Initialize the GitHub module configuration. .EXAMPLE + ```powershell Initialize-GitHubConfig + ``` Initializes the GitHub module configuration. .EXAMPLE + ```powershell Initialize-GitHubConfig -Force + ``` Forces the initialization of the GitHub module configuration. #> diff --git a/src/functions/private/Core/ConvertTo-GitHubGraphQLField.ps1 b/src/functions/private/Core/ConvertTo-GitHubGraphQLField.ps1 index b2616810d..035e0d37f 100644 --- a/src/functions/private/Core/ConvertTo-GitHubGraphQLField.ps1 +++ b/src/functions/private/Core/ConvertTo-GitHubGraphQLField.ps1 @@ -10,8 +10,10 @@ Properties not found in the mapping table are skipped with a warning. .EXAMPLE + ```powershell $fields = ConvertTo-GitHubGraphQLField -Property @('Name','Owner') -AdditionalProperty 'Url' -PropertyToGraphQLMap $map Returns the GraphQL fields for Name, Owner, and Url. + ``` .OUTPUTS string diff --git a/src/functions/private/Enterprise/Get-GitHubEnterpriseByName.ps1 b/src/functions/private/Enterprise/Get-GitHubEnterpriseByName.ps1 index 81d33aa5d..a26ff00b8 100644 --- a/src/functions/private/Enterprise/Get-GitHubEnterpriseByName.ps1 +++ b/src/functions/private/Enterprise/Get-GitHubEnterpriseByName.ps1 @@ -9,7 +9,9 @@ information. .EXAMPLE + ```powershell Get-GitHubEnterpriseByName -Name 'my-enterprise' + ``` Output: ```powershell diff --git a/src/functions/private/Enterprise/Get-GitHubEnterpriseList.ps1 b/src/functions/private/Enterprise/Get-GitHubEnterpriseList.ps1 index cd2f890e4..b30d4fbb4 100644 --- a/src/functions/private/Enterprise/Get-GitHubEnterpriseList.ps1 +++ b/src/functions/private/Enterprise/Get-GitHubEnterpriseList.ps1 @@ -8,7 +8,9 @@ creation dates, and other metadata. It returns an array of objects of type GitHubEnterprise populated with this information. .EXAMPLE + ```powershell Get-GitHubEnterpriseList + ``` Output: ```powershell diff --git a/src/functions/private/Environments/Get-GitHubEnvironmentByName.ps1 b/src/functions/private/Environments/Get-GitHubEnvironmentByName.ps1 index bd0c7392d..dfd79e826 100644 --- a/src/functions/private/Environments/Get-GitHubEnvironmentByName.ps1 +++ b/src/functions/private/Environments/Get-GitHubEnvironmentByName.ps1 @@ -13,10 +13,12 @@ to use this function with a private repository. .EXAMPLE + ```powershell Get-GitHubEnvironment -Owner 'PSModule' -Repository 'EnvironmentTest' -Name 'test' + ``` Output: - ```pwsh + ```powershell id : 5944178128 node_id : EN_kwDOOJqfM88AAAABYkz10A name : test diff --git a/src/functions/private/Environments/Get-GitHubEnvironmentList.ps1 b/src/functions/private/Environments/Get-GitHubEnvironmentList.ps1 index 3748f44a8..b86799850 100644 --- a/src/functions/private/Environments/Get-GitHubEnvironmentList.ps1 +++ b/src/functions/private/Environments/Get-GitHubEnvironmentList.ps1 @@ -10,10 +10,12 @@ to use this endpoint with a private repository. .EXAMPLE + ```powershell Get-GitHubEnvironmentList -Owner 'PSModule' -Repository 'EnvironmentTest' + ``` Output: - ```pwsh + ```powershell id : 5944178128 node_id : EN_kwDOOJqfM88AAAABYkz10A name : test diff --git a/src/functions/private/Gitignore/Get-GitHubGitignoreByName.ps1 b/src/functions/private/Gitignore/Get-GitHubGitignoreByName.ps1 index 704073b90..51e8d35ce 100644 --- a/src/functions/private/Gitignore/Get-GitHubGitignoreByName.ps1 +++ b/src/functions/private/Gitignore/Get-GitHubGitignoreByName.ps1 @@ -8,7 +8,9 @@ Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. .EXAMPLE + ```powershell Get-GitHubGitignoreList + ``` Get all gitignore templates diff --git a/src/functions/private/Gitignore/Get-GitHubGitignoreList.ps1 b/src/functions/private/Gitignore/Get-GitHubGitignoreList.ps1 index fc6f70114..ee649b12c 100644 --- a/src/functions/private/Gitignore/Get-GitHubGitignoreList.ps1 +++ b/src/functions/private/Gitignore/Get-GitHubGitignoreList.ps1 @@ -8,7 +8,9 @@ [creating a repository](https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user). .EXAMPLE + ```powershell Get-GitHubGitignoreList + ``` Get all gitignore templates diff --git a/src/functions/private/License/Get-GitHubLicenseByName.ps1 b/src/functions/private/License/Get-GitHubLicenseByName.ps1 index e1924aaff..00ddf1bee 100644 --- a/src/functions/private/License/Get-GitHubLicenseByName.ps1 +++ b/src/functions/private/License/Get-GitHubLicenseByName.ps1 @@ -8,7 +8,9 @@ For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." .EXAMPLE + ```powershell Get-GitHubGitignoreList + ``` Get all gitignore templates diff --git a/src/functions/private/License/Get-GitHubLicenseList.ps1 b/src/functions/private/License/Get-GitHubLicenseList.ps1 index 436596194..3d99c2cb8 100644 --- a/src/functions/private/License/Get-GitHubLicenseList.ps1 +++ b/src/functions/private/License/Get-GitHubLicenseList.ps1 @@ -8,7 +8,9 @@ For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." .EXAMPLE + ```powershell Get-GitHubLicenseList + ``` Get all commonly used licenses. diff --git a/src/functions/private/License/Get-GitHubRepositoryLicense.ps1 b/src/functions/private/License/Get-GitHubRepositoryLicense.ps1 index 31e4dfd1e..94fcad8f4 100644 --- a/src/functions/private/License/Get-GitHubRepositoryLicense.ps1 +++ b/src/functions/private/License/Get-GitHubRepositoryLicense.ps1 @@ -10,7 +10,9 @@ [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. .EXAMPLE + ```powershell Get-GitHubRepositoryLicense -Owner 'octocat' -Repository 'Hello-World' + ``` Get the license for the Hello-World repository from the octocat account. diff --git a/src/functions/private/Organization/Blocking/Block-GitHubUserByOrganization.ps1 b/src/functions/private/Organization/Blocking/Block-GitHubUserByOrganization.ps1 index d25d9f1e2..c89ab39f8 100644 --- a/src/functions/private/Organization/Blocking/Block-GitHubUserByOrganization.ps1 +++ b/src/functions/private/Organization/Blocking/Block-GitHubUserByOrganization.ps1 @@ -8,7 +8,9 @@ If the organization cannot block the given user a 422 is returned. .EXAMPLE + ```powershell Block-GitHubUserByOrganization -Organization 'github' -Username 'octocat' + ``` Blocks the user 'octocat' from the organization 'github'. Returns $true if successful, $false if not. diff --git a/src/functions/private/Organization/Blocking/Get-GitHubBlockedUserByOrganization.ps1 b/src/functions/private/Organization/Blocking/Get-GitHubBlockedUserByOrganization.ps1 index 5830f3a51..096eff942 100644 --- a/src/functions/private/Organization/Blocking/Get-GitHubBlockedUserByOrganization.ps1 +++ b/src/functions/private/Organization/Blocking/Get-GitHubBlockedUserByOrganization.ps1 @@ -7,7 +7,9 @@ List the users blocked by an organization. .EXAMPLE + ```powershell Get-GitHubBlockedUserByOrganization -Organization 'github' + ``` Lists all users blocked by the organization `github`. diff --git a/src/functions/private/Organization/Blocking/Test-GitHubBlockedUserByOrganization.ps1 b/src/functions/private/Organization/Blocking/Test-GitHubBlockedUserByOrganization.ps1 index b2dbc1fac..344101cef 100644 --- a/src/functions/private/Organization/Blocking/Test-GitHubBlockedUserByOrganization.ps1 +++ b/src/functions/private/Organization/Blocking/Test-GitHubBlockedUserByOrganization.ps1 @@ -8,7 +8,9 @@ Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. .EXAMPLE + ```powershell Test-GitHubBlockedUserByOrganization -Organization 'PSModule' -Username 'octocat' + ``` Checks if the user `octocat` is blocked by the organization `PSModule`. Returns true if the user is blocked, false if not. diff --git a/src/functions/private/Organization/Blocking/Unblock-GitHubUserByOrganization.ps1 b/src/functions/private/Organization/Blocking/Unblock-GitHubUserByOrganization.ps1 index 384cf5a73..ba1fbb1fc 100644 --- a/src/functions/private/Organization/Blocking/Unblock-GitHubUserByOrganization.ps1 +++ b/src/functions/private/Organization/Blocking/Unblock-GitHubUserByOrganization.ps1 @@ -7,7 +7,9 @@ Unblocks the given user on behalf of the specified organization. .EXAMPLE + ```powershell Unblock-GitHubUserByOrganization -Organization 'github' -Username 'octocat' + ``` Unblocks the user 'octocat' from the organization 'github'. Returns $true if successful. diff --git a/src/functions/private/Organization/Get-GitHubAllOrganization.ps1 b/src/functions/private/Organization/Get-GitHubAllOrganization.ps1 index 159d39b7f..6c00b0eac 100644 --- a/src/functions/private/Organization/Get-GitHubAllOrganization.ps1 +++ b/src/functions/private/Organization/Get-GitHubAllOrganization.ps1 @@ -10,7 +10,9 @@ 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 + ```powershell Get-GitHubAllOrganization -Since 142951047 + ``` List organizations, starting with PSModule diff --git a/src/functions/private/Organization/Get-GitHubOrganizationByName.ps1 b/src/functions/private/Organization/Get-GitHubOrganizationByName.ps1 index 87b512ae2..5ef0899ee 100644 --- a/src/functions/private/Organization/Get-GitHubOrganizationByName.ps1 +++ b/src/functions/private/Organization/Get-GitHubOrganizationByName.ps1 @@ -15,7 +15,9 @@ for details. For an example response, see 'Response with GitHub plan information' below." .EXAMPLE + ```powershell Get-GitHubOrganizationByName -Name 'github' + ``` Get the 'GitHub' organization diff --git a/src/functions/private/Organization/Get-GitHubOrganizationListForAuthUser.ps1 b/src/functions/private/Organization/Get-GitHubOrganizationListForAuthUser.ps1 index a8024ee6b..0fad06297 100644 --- a/src/functions/private/Organization/Get-GitHubOrganizationListForAuthUser.ps1 +++ b/src/functions/private/Organization/Get-GitHubOrganizationListForAuthUser.ps1 @@ -8,7 +8,9 @@ creation dates, member counts, and other metadata. It returns an array of objects of type GitHubOrganization populated with this information. .EXAMPLE + ```powershell Get-GitHubOrganizationListForAuthUser + ``` Output: ```powershell diff --git a/src/functions/private/Organization/Get-GitHubUserOrganization.ps1 b/src/functions/private/Organization/Get-GitHubUserOrganization.ps1 index f76da4920..25257ecdf 100644 --- a/src/functions/private/Organization/Get-GitHubUserOrganization.ps1 +++ b/src/functions/private/Organization/Get-GitHubUserOrganization.ps1 @@ -13,7 +13,9 @@ API instead. .EXAMPLE + ```powershell Get-GitHubUserOrganization -Username 'octocat' + ``` List public organizations for the user 'octocat'. diff --git a/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByID.ps1 b/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByID.ps1 index 71a9a4053..7d9e8cc27 100644 --- a/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByID.ps1 +++ b/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByID.ps1 @@ -10,7 +10,9 @@ possible. API clients should handle both a `200` or `302` response. .EXAMPLE + ```powershell Get-GitHubReleaseAssetByID -Owner 'octocat' -Repository 'hello-world' -ID '1234567' + ``` Gets the release asset with the ID '1234567' for the repository 'octocat/hello-world'. diff --git a/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByReleaseID.ps1 b/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByReleaseID.ps1 index 6d81aeace..3463a487d 100644 --- a/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByReleaseID.ps1 +++ b/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByReleaseID.ps1 @@ -7,12 +7,16 @@ List release assets .EXAMPLE + ```powershell Get-GitHubReleaseAssetByReleaseID -Owner 'octocat' -Repository 'hello-world' -ID '1234567' + ``` Gets the release assets for the release with the ID '1234567' for the repository 'octocat/hello-world'. .EXAMPLE + ```powershell Get-GitHubReleaseAssetByReleaseID -Owner 'octocat' -Repository 'hello-world' -ID '1234567' -Name 'example.zip' + ``` Gets only the release asset named 'example.zip' for the release with the ID '1234567'. diff --git a/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByTag.ps1 b/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByTag.ps1 index ad523dcc0..b51471287 100644 --- a/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByTag.ps1 +++ b/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByTag.ps1 @@ -8,12 +8,16 @@ Uses pagination to retrieve all assets even if there are more than the maximum per page. .EXAMPLE + ```powershell Get-GitHubReleaseAssetByTag -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' + ``` Gets all release assets for the release with the tag 'v1.0.0' for the repository 'octocat/hello-world'. .EXAMPLE + ```powershell Get-GitHubReleaseAssetByTag -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Name 'app.zip' + ``` Gets a specific release asset named 'app.zip' from the release with the tag 'v1.0.0' for the repository 'octocat/hello-world'. diff --git a/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetFromLatest.ps1 b/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetFromLatest.ps1 index c0bbde666..26628315f 100644 --- a/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetFromLatest.ps1 +++ b/src/functions/private/Releases/Assets/Get-GitHubReleaseAssetFromLatest.ps1 @@ -9,12 +9,16 @@ The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. .EXAMPLE + ```powershell Get-GitHubReleaseAssetFromLatest -Owner 'octocat' -Repository 'hello-world' + ``` Gets the assets for the latest release of the repository 'hello-world' owned by 'octocat'. .EXAMPLE + ```powershell Get-GitHubReleaseAssetFromLatest -Owner 'octocat' -Repository 'hello-world' -Name 'asset-name' + ``` Gets the assets for the latest release of the repository 'hello-world' owned by 'octocat'. diff --git a/src/functions/private/Releases/Get-GitHubReleaseAll.ps1 b/src/functions/private/Releases/Get-GitHubReleaseAll.ps1 index 4e04235f7..f3e499ed4 100644 --- a/src/functions/private/Releases/Get-GitHubReleaseAll.ps1 +++ b/src/functions/private/Releases/Get-GitHubReleaseAll.ps1 @@ -9,7 +9,9 @@ Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. .EXAMPLE + ```powershell Get-GitHubReleaseAll -Owner 'octocat' -Repository 'hello-world' + ``` Gets all the releases for the repository 'hello-world' owned by 'octocat'. diff --git a/src/functions/private/Releases/Get-GitHubReleaseByID.ps1 b/src/functions/private/Releases/Get-GitHubReleaseByID.ps1 index 0fa9cf1f7..a7564d770 100644 --- a/src/functions/private/Releases/Get-GitHubReleaseByID.ps1 +++ b/src/functions/private/Releases/Get-GitHubReleaseByID.ps1 @@ -8,7 +8,9 @@ This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). .EXAMPLE + ```powershell Get-GitHubReleaseById -Owner 'octocat' -Repository 'hello-world' -ID '1234567' + ``` Gets the release with the ID '1234567' for the repository 'hello-world' owned by 'octocat'. diff --git a/src/functions/private/Releases/Get-GitHubReleaseByTagName.ps1 b/src/functions/private/Releases/Get-GitHubReleaseByTagName.ps1 index 7577e5c7e..dea520db9 100644 --- a/src/functions/private/Releases/Get-GitHubReleaseByTagName.ps1 +++ b/src/functions/private/Releases/Get-GitHubReleaseByTagName.ps1 @@ -7,7 +7,9 @@ Get a published release with the specified tag. .EXAMPLE + ```powershell Get-GitHubReleaseByTagName -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' + ``` Gets the release with the tag 'v1.0.0' for the repository 'hello-world' owned by 'octocat'. diff --git a/src/functions/private/Releases/Get-GitHubReleaseLatest.ps1 b/src/functions/private/Releases/Get-GitHubReleaseLatest.ps1 index 221afdbb1..6573b0908 100644 --- a/src/functions/private/Releases/Get-GitHubReleaseLatest.ps1 +++ b/src/functions/private/Releases/Get-GitHubReleaseLatest.ps1 @@ -9,7 +9,9 @@ The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. .EXAMPLE + ```powershell Get-GitHubReleaseLatest -Owner 'octocat' -Repository 'hello-world' + ``` Gets the latest releases for the repository 'hello-world' owned by 'octocat'. diff --git a/src/functions/private/Repositories/Autolinks/Get-GitHubRepositoryAutolinkById.ps1 b/src/functions/private/Repositories/Autolinks/Get-GitHubRepositoryAutolinkById.ps1 index 64dad648a..7e7aa0460 100644 --- a/src/functions/private/Repositories/Autolinks/Get-GitHubRepositoryAutolinkById.ps1 +++ b/src/functions/private/Repositories/Autolinks/Get-GitHubRepositoryAutolinkById.ps1 @@ -9,7 +9,9 @@ Information about autolinks are only available to repository administrators. .EXAMPLE + ```powershell Get-GitHubRepositoryAutolinkById -Owner 'octocat' -Repository 'Hello-World' -ID 1 + ``` Gets the autolink with the ID 1 for the repository 'Hello-World' owned by 'octocat'. diff --git a/src/functions/private/Repositories/Autolinks/Get-GitHubRepositoryAutolinkList.ps1 b/src/functions/private/Repositories/Autolinks/Get-GitHubRepositoryAutolinkList.ps1 index cda80c94d..485ab8119 100644 --- a/src/functions/private/Repositories/Autolinks/Get-GitHubRepositoryAutolinkList.ps1 +++ b/src/functions/private/Repositories/Autolinks/Get-GitHubRepositoryAutolinkList.ps1 @@ -9,7 +9,9 @@ Information about autolinks are only available to repository administrators. .EXAMPLE + ```powershell Get-GitHubRepositoryAutolinkList -Owner 'octocat' -Repository 'Hello-World' + ``` Gets all autolinks for the repository 'Hello-World' owned by 'octocat'. diff --git a/src/functions/private/Repositories/Get-GitHubMyRepositories.ps1 b/src/functions/private/Repositories/Get-GitHubMyRepositories.ps1 index f79bdc32e..b2a446f88 100644 --- a/src/functions/private/Repositories/Get-GitHubMyRepositories.ps1 +++ b/src/functions/private/Repositories/Get-GitHubMyRepositories.ps1 @@ -9,12 +9,16 @@ they are a collaborator, and repositories that they can access through an organization membership. .EXAMPLE + ```powershell Get-GitHubMyRepositories + ``` Gets the repositories for the authenticated user. .EXAMPLE + ```powershell Get-GitHubMyRepositories -Visibility 'private' + ``` Gets the private repositories for the authenticated user. diff --git a/src/functions/private/Repositories/Get-GitHubMyRepositoryByName.ps1 b/src/functions/private/Repositories/Get-GitHubMyRepositoryByName.ps1 index 14d125396..ff9d01bf8 100644 --- a/src/functions/private/Repositories/Get-GitHubMyRepositoryByName.ps1 +++ b/src/functions/private/Repositories/Get-GitHubMyRepositoryByName.ps1 @@ -9,7 +9,9 @@ they are a collaborator, and repositories that they can access through an organization membership. .EXAMPLE + ```powershell Get-GitHubMyRepositoryByName + ``` Gets the repositories for the authenticated user. diff --git a/src/functions/private/Repositories/Get-GitHubRepositoryByName.ps1 b/src/functions/private/Repositories/Get-GitHubRepositoryByName.ps1 index 06d6cd896..d3788be41 100644 --- a/src/functions/private/Repositories/Get-GitHubRepositoryByName.ps1 +++ b/src/functions/private/Repositories/Get-GitHubRepositoryByName.ps1 @@ -11,7 +11,9 @@ For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." .EXAMPLE + ```powershell Get-GitHubRepositoryByName -Owner 'octocat' -Name 'Hello-World' + ``` Gets the repository 'Hello-World' for the organization 'octocat'. diff --git a/src/functions/private/Repositories/Get-GitHubRepositoryByNameAndTeam.ps1 b/src/functions/private/Repositories/Get-GitHubRepositoryByNameAndTeam.ps1 index 594ed1ed8..823ff64d3 100644 --- a/src/functions/private/Repositories/Get-GitHubRepositoryByNameAndTeam.ps1 +++ b/src/functions/private/Repositories/Get-GitHubRepositoryByNameAndTeam.ps1 @@ -7,7 +7,9 @@ Retrieves the permission level assigned to a specific team for a given GitHub repository. .EXAMPLE + ```powershell Get-GitHubRepositoryByNameAndTeam -Owner 'octocat' -Name 'Hello-World' -Team 'core' + ``` Output: ```powershell diff --git a/src/functions/private/Repositories/Get-GitHubRepositoryListByOwner.ps1 b/src/functions/private/Repositories/Get-GitHubRepositoryListByOwner.ps1 index 6476885ec..92cfe5b54 100644 --- a/src/functions/private/Repositories/Get-GitHubRepositoryListByOwner.ps1 +++ b/src/functions/private/Repositories/Get-GitHubRepositoryListByOwner.ps1 @@ -8,17 +8,23 @@ Note: For GitHub AE, this endpoint will list internal repositories for the specified user. .EXAMPLE + ```powershell Get-GitHubRepositoryListByOwner -Owner 'octocat' + ``` Gets the repositories for the user 'octocat'. .EXAMPLE + ```powershell Get-GitHubRepositoryListByOwner -Owner 'octocat' -Type 'member' + ``` Gets the repositories of organizations where the user 'octocat' is a member. .EXAMPLE + ```powershell Get-GitHubRepositoryListByOwner -Owner 'octocat' -Sort 'created' -Direction 'asc' + ``` Gets the repositories for the user 'octocat' sorted by creation date in ascending order. diff --git a/src/functions/private/Repositories/Get-GitHubRepositoryListByTeam.ps1 b/src/functions/private/Repositories/Get-GitHubRepositoryListByTeam.ps1 index 95e2c9238..5c456d317 100644 --- a/src/functions/private/Repositories/Get-GitHubRepositoryListByTeam.ps1 +++ b/src/functions/private/Repositories/Get-GitHubRepositoryListByTeam.ps1 @@ -7,10 +7,8 @@ Lists a team's repositories visible to the authenticated user. .EXAMPLE - Get-GitHubRepositoryListByTeam -Owner 'octocat' -Team 'core' - - Output: ```powershell + Get-GitHubRepositoryListByTeam -Owner 'octocat' -Team 'core' ``` Lists all repositories that the 'core' team has access to in the organization owned by 'octocat'. diff --git a/src/functions/private/Repositories/New-GitHubRepositoryAsFork.ps1 b/src/functions/private/Repositories/New-GitHubRepositoryAsFork.ps1 index b29c11f2a..8202415f8 100644 --- a/src/functions/private/Repositories/New-GitHubRepositoryAsFork.ps1 +++ b/src/functions/private/Repositories/New-GitHubRepositoryAsFork.ps1 @@ -13,23 +13,31 @@ repositories and on the source account with access to the source repository. .EXAMPLE + ```powershell New-GitHubRepositoryAsFork -ForkOwner 'github' -ForkRepository 'Hello-World' + ``` Fork the repository `Hello-World` owned by `github` for the authenticated user. Repo will be named `Hello-World`, and all branches and tags will be forked. .EXAMPLE + ```powershell New-GitHubRepositoryAsFork -ForkOwner 'github' -ForkRepository 'Hello-World' -Name 'Hello-World-2' + ``` Fork the repository `Hello-World` owned by `github` for the authenticated user, naming the resulting repository `Hello-World-2`. .EXAMPLE + ```powershell New-GitHubRepositoryAsFork -ForkOwner 'github' -ForkRepository 'Hello-World' -Owner 'octocat' + ``` Fork the repository `Hello-World` owned by `github` for the organization `octocat`, naming the resulting repository `Hello-World`. .EXAMPLE + ```powershell New-GitHubRepositoryAsFork -ForkOwner 'github' -ForkRepository 'Hello-World' -IncludeAllBranches + ``` Fork the repository `Hello-World` owned by `github` for the authenticated user, including all the branches from the source. diff --git a/src/functions/private/Repositories/New-GitHubRepositoryFromTemplate.ps1 b/src/functions/private/Repositories/New-GitHubRepositoryFromTemplate.ps1 index 388483be0..3e18af4cb 100644 --- a/src/functions/private/Repositories/New-GitHubRepositoryFromTemplate.ps1 +++ b/src/functions/private/Repositories/New-GitHubRepositoryFromTemplate.ps1 @@ -18,6 +18,7 @@ * `repo` scope to create a private repository .EXAMPLE + ```powershell $params = @{ TemplateOwner = 'GitHub' TemplateRepository = 'octocat' @@ -28,6 +29,7 @@ Private = $true } New-GitHubRepositoryFromTemplate @params + ``` Creates a new private repository named `MyNewRepo` from the `octocat` template repository owned by `GitHub`. diff --git a/src/functions/private/Repositories/New-GitHubRepositoryOrg.ps1 b/src/functions/private/Repositories/New-GitHubRepositoryOrg.ps1 index 8a4b91906..7007658ca 100644 --- a/src/functions/private/Repositories/New-GitHubRepositoryOrg.ps1 +++ b/src/functions/private/Repositories/New-GitHubRepositoryOrg.ps1 @@ -14,6 +14,7 @@ * `repo` scope to create a private repository .EXAMPLE + ```powershell $params = @{ Owner = 'PSModule' Name = 'Hello-World' @@ -31,6 +32,7 @@ SquashMergeCommitMessage = 'PR_BODY' } New-GitHubRepositoryOrg @params + ``` Creates a new public repository named "Hello-World" owned by the organization "PSModule". diff --git a/src/functions/private/Repositories/New-GitHubRepositoryUser.ps1 b/src/functions/private/Repositories/New-GitHubRepositoryUser.ps1 index fbfaf3406..26a7e1076 100644 --- a/src/functions/private/Repositories/New-GitHubRepositoryUser.ps1 +++ b/src/functions/private/Repositories/New-GitHubRepositoryUser.ps1 @@ -14,6 +14,7 @@ * `repo` scope to create a private repository. .EXAMPLE + ```powershell $params = @{ Name = 'Hello-World' Description = 'This is your first repository' @@ -30,6 +31,7 @@ SquashMergeCommitMessage = 'PR_BODY' } New-GitHubRepositoryUser @params + ``` Creates a new public repository named "Hello-World" owned by the authenticated user. diff --git a/src/functions/private/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuiteById.ps1 b/src/functions/private/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuiteById.ps1 index 9e80908b9..f9bdd562d 100644 --- a/src/functions/private/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuiteById.ps1 +++ b/src/functions/private/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuiteById.ps1 @@ -8,7 +8,9 @@ For more information, see "[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." .EXAMPLE + ```powershell Get-GitHubRepositoryRuleSuiteById -Owner 'octocat' -Repository 'hello-world' -RuleSuiteId 123456789 + ``` Gets information about a suite of rule evaluations with ID 123456789 from within the octocat/hello-world repository. diff --git a/src/functions/private/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuiteList.ps1 b/src/functions/private/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuiteList.ps1 index 629992264..dcb029a13 100644 --- a/src/functions/private/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuiteList.ps1 +++ b/src/functions/private/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuiteList.ps1 @@ -8,6 +8,7 @@ For more information, see"[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Repo = 'hello-world' @@ -17,6 +18,7 @@ RuleSuiteResult = 'all' } Get-GitHubRepositoryRuleSuiteList @params + ``` Gets a list of rule suites for the main branch of the hello-world repository owned by octocat. diff --git a/src/functions/private/Secrets/Get-GitHubSecretEnvironmentByName.ps1 b/src/functions/private/Secrets/Get-GitHubSecretEnvironmentByName.ps1 index 669765d48..7493b3b66 100644 --- a/src/functions/private/Secrets/Get-GitHubSecretEnvironmentByName.ps1 +++ b/src/functions/private/Secrets/Get-GitHubSecretEnvironmentByName.ps1 @@ -8,7 +8,9 @@ create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubSecretEnvironmentByName -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Name 'SECRET1' -Context $GitHubContext + ``` Output: ```powershell diff --git a/src/functions/private/Secrets/Get-GitHubSecretEnvironmentList.ps1 b/src/functions/private/Secrets/Get-GitHubSecretEnvironmentList.ps1 index 6f63d6c15..91198f552 100644 --- a/src/functions/private/Secrets/Get-GitHubSecretEnvironmentList.ps1 +++ b/src/functions/private/Secrets/Get-GitHubSecretEnvironmentList.ps1 @@ -9,7 +9,9 @@ endpoint. .EXAMPLE + ```powershell Get-GitHubSecretEnvironmentList -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Context $GitHubContext + ``` Output: ```powershell diff --git a/src/functions/private/Secrets/Get-GitHubSecretFromOrganization.ps1 b/src/functions/private/Secrets/Get-GitHubSecretFromOrganization.ps1 index 67df30aa0..d33a68b10 100644 --- a/src/functions/private/Secrets/Get-GitHubSecretFromOrganization.ps1 +++ b/src/functions/private/Secrets/Get-GitHubSecretFromOrganization.ps1 @@ -9,7 +9,9 @@ this endpoint. .EXAMPLE + ```powershell Get-GitHubSecretFromOrganization -Owner 'octocat' -Repository 'helloworld' -Context (Get-GitHubContext) + ``` Output: ```powershell diff --git a/src/functions/private/Secrets/Get-GitHubSecretOwnerByName.ps1 b/src/functions/private/Secrets/Get-GitHubSecretOwnerByName.ps1 index 97179d7fe..48ff3e591 100644 --- a/src/functions/private/Secrets/Get-GitHubSecretOwnerByName.ps1 +++ b/src/functions/private/Secrets/Get-GitHubSecretOwnerByName.ps1 @@ -12,7 +12,9 @@ the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubSecretOwnerByName -Owner 'octocat' -Name 'SECRET_THING' -Context (Get-GitHubContext) + ``` Output: ```powershell diff --git a/src/functions/private/Secrets/Get-GitHubSecretOwnerList.ps1 b/src/functions/private/Secrets/Get-GitHubSecretOwnerList.ps1 index 0289fb8ea..3eec25c1b 100644 --- a/src/functions/private/Secrets/Get-GitHubSecretOwnerList.ps1 +++ b/src/functions/private/Secrets/Get-GitHubSecretOwnerList.ps1 @@ -9,10 +9,8 @@ endpoint. If the repository is private, the `repo` scope is also required. .EXAMPLE - Get-GitHubSecretOwnerList -Owner 'PSModule' -Context (Get-GitHubContext) - - Output: ```powershell + Get-GitHubSecretOwnerList -Owner 'PSModule' -Context (Get-GitHubContext) ``` Retrieves all secrets from the specified organization. diff --git a/src/functions/private/Secrets/Get-GitHubSecretRepositoryByName.ps1 b/src/functions/private/Secrets/Get-GitHubSecretRepositoryByName.ps1 index 19ddfba4e..c9284f628 100644 --- a/src/functions/private/Secrets/Get-GitHubSecretRepositoryByName.ps1 +++ b/src/functions/private/Secrets/Get-GitHubSecretRepositoryByName.ps1 @@ -8,7 +8,9 @@ to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubSecretRepositoryByName -Owner 'octocat' -Repository 'Hello-World' -Name 'SECRET1' -Context (Get-GitHubContext) + ``` Output: ```powershell diff --git a/src/functions/private/Secrets/Get-GitHubSecretRepositoryList.ps1 b/src/functions/private/Secrets/Get-GitHubSecretRepositoryList.ps1 index 26501bd19..8b7a04fa7 100644 --- a/src/functions/private/Secrets/Get-GitHubSecretRepositoryList.ps1 +++ b/src/functions/private/Secrets/Get-GitHubSecretRepositoryList.ps1 @@ -9,7 +9,9 @@ endpoint. .EXAMPLE + ```powershell Get-GitHubSecretRepositoryList -Owner 'octocat' -Repository 'Hello-World' -Context (Get-GitHubContext) + ``` Output: ```powershell diff --git a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnEnvironment.ps1 b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnEnvironment.ps1 index 0c0977b76..2d33f62fb 100644 --- a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnEnvironment.ps1 +++ b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnEnvironment.ps1 @@ -9,7 +9,9 @@ access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubPublicKeyForActionOnEnvironment -Owner 'octocat' -Repository 'hello-world' -Environment 'prod' -Context $GitHubContext + ``` Outputs: ```powershell diff --git a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnOrganization.ps1 b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnOrganization.ps1 index 6f6d799a8..2232fe74a 100644 --- a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnOrganization.ps1 +++ b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnOrganization.ps1 @@ -10,7 +10,9 @@ need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubPublicKeyForActionOnOrganization -Owner 'octocat' -Context $GitHubContext + ``` Outputs: ```powershell diff --git a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnRepository.ps1 b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnRepository.ps1 index 7812b8754..174566349 100644 --- a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnRepository.ps1 +++ b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForActionOnRepository.ps1 @@ -9,7 +9,9 @@ the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubPublicKeyForActionOnRepository -Owner 'octocat' -Repository 'hello-world' -Context $GitHubContext + ``` Outputs: ```powershell diff --git a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnOrganization.ps1 b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnOrganization.ps1 index f93081abe..4e6ad64ea 100644 --- a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnOrganization.ps1 +++ b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnOrganization.ps1 @@ -8,7 +8,9 @@ can create or update secrets. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubPublicKeyForCodespacesOnOrganization -Owner 'octocat' -Context $GitHubContext + ``` Outputs: ```powershell diff --git a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnRepository.ps1 b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnRepository.ps1 index a3ee90088..c67cb597a 100644 --- a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnRepository.ps1 +++ b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnRepository.ps1 @@ -8,7 +8,9 @@ repository is private, OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubPublicKeyForCodespacesOnRepository -Owner 'octocat' -Repository 'hello-world' -Context $GitHubContext + ``` Outputs: ```powershell diff --git a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnUser.ps1 b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnUser.ps1 index 27eb34411..c31f13c7b 100644 --- a/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnUser.ps1 +++ b/src/functions/private/Secrets/PublicKey/Get-GitHubPublicKeyForCodespacesOnUser.ps1 @@ -9,7 +9,9 @@ OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubPublicKeyForCodespacesOnUser -Context $GitHubContext + ``` Outputs: ```powershell diff --git a/src/functions/private/Secrets/Remove-GitHubSecretFromEnvironment.ps1 b/src/functions/private/Secrets/Remove-GitHubSecretFromEnvironment.ps1 index a7838c887..b25d32db6 100644 --- a/src/functions/private/Secrets/Remove-GitHubSecretFromEnvironment.ps1 +++ b/src/functions/private/Secrets/Remove-GitHubSecretFromEnvironment.ps1 @@ -8,7 +8,9 @@ or read secrets. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Remove-GitHubSecretFromEnvironment -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Name 'SECRET1' -Context $GitHubContext + ``` Deletes the specified secret from the specified environment. diff --git a/src/functions/private/Secrets/Remove-GitHubSecretFromOwner.ps1 b/src/functions/private/Secrets/Remove-GitHubSecretFromOwner.ps1 index 7cdb07809..2841d95fa 100644 --- a/src/functions/private/Secrets/Remove-GitHubSecretFromOwner.ps1 +++ b/src/functions/private/Secrets/Remove-GitHubSecretFromOwner.ps1 @@ -9,7 +9,9 @@ is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Remove-GitHubSecretFromOwner -Owner 'octocat' -Name 'HOST_NAME' -Context $GitHubContext + ``` Deletes the specified secret from the specified organization. diff --git a/src/functions/private/Secrets/Remove-GitHubSecretFromRepository.ps1 b/src/functions/private/Secrets/Remove-GitHubSecretFromRepository.ps1 index a6cce0757..400739b82 100644 --- a/src/functions/private/Secrets/Remove-GitHubSecretFromRepository.ps1 +++ b/src/functions/private/Secrets/Remove-GitHubSecretFromRepository.ps1 @@ -8,7 +8,9 @@ or read secrets. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Remove-GitHubSecretFromRepository -Owner 'octocat' -Repository 'Hello-World' -Name 'SECRET1' -Context $GitHubContext + ``` Deletes the specified secret from the specified repository. diff --git a/src/functions/private/Secrets/Set-GitHubSecretOnEnvironment.ps1 b/src/functions/private/Secrets/Set-GitHubSecretOnEnvironment.ps1 index 1631f4c88..927f55681 100644 --- a/src/functions/private/Secrets/Set-GitHubSecretOnEnvironment.ps1 +++ b/src/functions/private/Secrets/Set-GitHubSecretOnEnvironment.ps1 @@ -11,6 +11,7 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Repository = 'Hello-World' @@ -20,6 +21,7 @@ Context = $GitHubContext } Set-GitHubSecretOnEnvironment @params + ``` Creates a new environment secret named `SECRET1` with the value `secret_value` in the specified environment. diff --git a/src/functions/private/Secrets/Set-GitHubSecretOnOwner.ps1 b/src/functions/private/Secrets/Set-GitHubSecretOnOwner.ps1 index 705c87672..abbda4608 100644 --- a/src/functions/private/Secrets/Set-GitHubSecretOnOwner.ps1 +++ b/src/functions/private/Secrets/Set-GitHubSecretOnOwner.ps1 @@ -12,7 +12,9 @@ the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Set-GitHubSecretOnOwner -Owner 'octocat' -Name 'HOST_NAME' -Value 'test_value' -Context $GitHubContext + ``` Creates a new organization secret named `HOST_NAME` with the value `test_value` in the specified organization. diff --git a/src/functions/private/Secrets/Set-GitHubSecretOnRepository.ps1 b/src/functions/private/Secrets/Set-GitHubSecretOnRepository.ps1 index 4ae7efdb1..9c1091bb4 100644 --- a/src/functions/private/Secrets/Set-GitHubSecretOnRepository.ps1 +++ b/src/functions/private/Secrets/Set-GitHubSecretOnRepository.ps1 @@ -11,7 +11,9 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Set-GitHubSecretOnRepository -Owner 'octocat' -Repository 'Hello-World' -Name 'SECRET1' -Value 'SECRET_VALUE' -Context $GitHubContext + ``` Creates a new repository secret named `SECRET1` with the value `SECRET_VALUE` in the specified repository. diff --git a/src/functions/private/Teams/Get-GitHubTeamBySlug.ps1 b/src/functions/private/Teams/Get-GitHubTeamBySlug.ps1 index 0b4b10245..918eec535 100644 --- a/src/functions/private/Teams/Get-GitHubTeamBySlug.ps1 +++ b/src/functions/private/Teams/Get-GitHubTeamBySlug.ps1 @@ -8,7 +8,9 @@ and replaces spaces with a - separator. For example, "My TEam Näme" would become my-team-name. .EXAMPLE + ```powershell Get-GitHubTeamBySlug -Organization 'github' -Slug 'my-team-name' + ``` .NOTES [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) diff --git a/src/functions/private/Teams/Get-GitHubTeamListByOrg.ps1 b/src/functions/private/Teams/Get-GitHubTeamListByOrg.ps1 index 7060a63c8..4ebb42862 100644 --- a/src/functions/private/Teams/Get-GitHubTeamListByOrg.ps1 +++ b/src/functions/private/Teams/Get-GitHubTeamListByOrg.ps1 @@ -7,7 +7,9 @@ Lists all teams in an organization that are visible to the authenticated user. .EXAMPLE + ```powershell Get-GitHubTeamListByOrg -Organization 'github' + ``` .OUTPUTS GitHubTeam[] diff --git a/src/functions/private/Teams/Get-GitHubTeamListByRepo.ps1 b/src/functions/private/Teams/Get-GitHubTeamListByRepo.ps1 index f01f277f1..89ff9bd47 100644 --- a/src/functions/private/Teams/Get-GitHubTeamListByRepo.ps1 +++ b/src/functions/private/Teams/Get-GitHubTeamListByRepo.ps1 @@ -10,7 +10,9 @@ and repo scope to use this endpoint with a private repository. .EXAMPLE + ```powershell Get-GitHubTeamListByRepo -Owner 'octocat' -Repository 'Hello-World' + ``` Output: ```powershell diff --git a/src/functions/private/Users/Blocking/Block-GitHubUserByUser.ps1 b/src/functions/private/Users/Blocking/Block-GitHubUserByUser.ps1 index 5333cc35a..cf5923b3b 100644 --- a/src/functions/private/Users/Blocking/Block-GitHubUserByUser.ps1 +++ b/src/functions/private/Users/Blocking/Block-GitHubUserByUser.ps1 @@ -7,7 +7,9 @@ Blocks the given user and returns a 204. If the authenticated user cannot block the given user a 422 is returned. .EXAMPLE + ```powershell Block-GitHubUserByUser -Username 'octocat' + ``` Blocks the user 'octocat' for the authenticated user. Returns $true if successful, $false if not. diff --git a/src/functions/private/Users/Blocking/Get-GitHubBlockedUserByUser.ps1 b/src/functions/private/Users/Blocking/Get-GitHubBlockedUserByUser.ps1 index 617a42038..24e84c0c4 100644 --- a/src/functions/private/Users/Blocking/Get-GitHubBlockedUserByUser.ps1 +++ b/src/functions/private/Users/Blocking/Get-GitHubBlockedUserByUser.ps1 @@ -7,7 +7,9 @@ List the users you've blocked on your personal account. .EXAMPLE + ```powershell Get-GitHubBlockedUserByUser + ``` Returns a list of users blocked by the authenticated user. diff --git a/src/functions/private/Users/Blocking/Test-GitHubBlockedUserByUser.ps1 b/src/functions/private/Users/Blocking/Test-GitHubBlockedUserByUser.ps1 index ee8eaf8ff..1e9c46330 100644 --- a/src/functions/private/Users/Blocking/Test-GitHubBlockedUserByUser.ps1 +++ b/src/functions/private/Users/Blocking/Test-GitHubBlockedUserByUser.ps1 @@ -9,7 +9,9 @@ or if the given user account has been identified as spam by GitHub. .EXAMPLE + ```powershell Test-GitHubBlockedUserByUser -Username 'octocat' + ``` Checks if the user `octocat` is blocked by the authenticated user. Returns true if the user is blocked, false if not. diff --git a/src/functions/private/Users/Blocking/Unblock-GitHubUserByUser.ps1 b/src/functions/private/Users/Blocking/Unblock-GitHubUserByUser.ps1 index f4270adc8..7b3277cb0 100644 --- a/src/functions/private/Users/Blocking/Unblock-GitHubUserByUser.ps1 +++ b/src/functions/private/Users/Blocking/Unblock-GitHubUserByUser.ps1 @@ -7,7 +7,9 @@ Unblocks the given user and returns a 204. .EXAMPLE + ```powershell Unblock-GitHubUserByUser -Username 'octocat' + ``` Unblocks the user 'octocat' for the authenticated user. Returns $true if successful. diff --git a/src/functions/private/Users/Emails/Get-GitHubUserAllEmail.ps1 b/src/functions/private/Users/Emails/Get-GitHubUserAllEmail.ps1 index 7a1167828..8a4e9a58e 100644 --- a/src/functions/private/Users/Emails/Get-GitHubUserAllEmail.ps1 +++ b/src/functions/private/Users/Emails/Get-GitHubUserAllEmail.ps1 @@ -8,7 +8,9 @@ This endpoint is accessible with the `user:email` scope. .EXAMPLE + ```powershell Get-GitHubUserAllEmail + ``` Gets all email addresses for the authenticated user. diff --git a/src/functions/private/Users/Emails/Get-GitHubUserPublicEmail.ps1 b/src/functions/private/Users/Emails/Get-GitHubUserPublicEmail.ps1 index f5e67b6f0..44fccd672 100644 --- a/src/functions/private/Users/Emails/Get-GitHubUserPublicEmail.ps1 +++ b/src/functions/private/Users/Emails/Get-GitHubUserPublicEmail.ps1 @@ -9,7 +9,9 @@ endpoint. This endpoint is accessible with the `user:email` scope. .EXAMPLE + ```powershell Get-GitHubUserPublicEmail + ``` Gets all public email addresses for the authenticated user. diff --git a/src/functions/private/Users/Followers/Get-GitHubUserFollowersOfUser.ps1 b/src/functions/private/Users/Followers/Get-GitHubUserFollowersOfUser.ps1 index abd3a7431..198bcd3f8 100644 --- a/src/functions/private/Users/Followers/Get-GitHubUserFollowersOfUser.ps1 +++ b/src/functions/private/Users/Followers/Get-GitHubUserFollowersOfUser.ps1 @@ -7,7 +7,9 @@ Lists the people following the specified user. .EXAMPLE + ```powershell Get-GitHubUserFollowersOfUser -Username 'octocat' + ``` Gets all followers of user 'octocat'. diff --git a/src/functions/private/Users/Followers/Get-GitHubUserFollowingMe.ps1 b/src/functions/private/Users/Followers/Get-GitHubUserFollowingMe.ps1 index 15509b6cc..59ff6fc54 100644 --- a/src/functions/private/Users/Followers/Get-GitHubUserFollowingMe.ps1 +++ b/src/functions/private/Users/Followers/Get-GitHubUserFollowingMe.ps1 @@ -7,7 +7,9 @@ Lists the people who the authenticated user follows. .EXAMPLE + ```powershell Get-GitHubUserFollowingMe + ``` Gets all people the authenticated user follows. diff --git a/src/functions/private/Users/Followers/Get-GitHubUserFollowingUser.ps1 b/src/functions/private/Users/Followers/Get-GitHubUserFollowingUser.ps1 index c75ff3e0b..c67816599 100644 --- a/src/functions/private/Users/Followers/Get-GitHubUserFollowingUser.ps1 +++ b/src/functions/private/Users/Followers/Get-GitHubUserFollowingUser.ps1 @@ -7,7 +7,9 @@ Lists the people who the specified user follows. .EXAMPLE + ```powershell Get-GitHubUserFollowingUser -Username 'octocat' + ``` Gets all people that 'octocat' follows. diff --git a/src/functions/private/Users/Followers/Get-GitHubUserMyFollower.ps1 b/src/functions/private/Users/Followers/Get-GitHubUserMyFollower.ps1 index e2244e1d7..05abfa288 100644 --- a/src/functions/private/Users/Followers/Get-GitHubUserMyFollower.ps1 +++ b/src/functions/private/Users/Followers/Get-GitHubUserMyFollower.ps1 @@ -7,7 +7,9 @@ Lists the people following the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserMyFollowers + ``` Gets all followers of the authenticated user. diff --git a/src/functions/private/Users/Followers/Test-GitHubUserFollowedByMe.ps1 b/src/functions/private/Users/Followers/Test-GitHubUserFollowedByMe.ps1 index c196d68c8..dd92bf3a1 100644 --- a/src/functions/private/Users/Followers/Test-GitHubUserFollowedByMe.ps1 +++ b/src/functions/private/Users/Followers/Test-GitHubUserFollowedByMe.ps1 @@ -8,7 +8,9 @@ Returns a 404 if the user is not followed by the authenticated user. .EXAMPLE + ```powershell Test-GitHubUserFollowedByMe -Username 'octocat' + ``` Checks if the authenticated user follows the user 'octocat'. diff --git a/src/functions/private/Users/Followers/Test-GitHubUserFollowedByUser.ps1 b/src/functions/private/Users/Followers/Test-GitHubUserFollowedByUser.ps1 index 56ab102f8..8b5681127 100644 --- a/src/functions/private/Users/Followers/Test-GitHubUserFollowedByUser.ps1 +++ b/src/functions/private/Users/Followers/Test-GitHubUserFollowedByUser.ps1 @@ -7,7 +7,9 @@ Checks if a user follows another user. .EXAMPLE + ```powershell Test-GitHubUserFollowedByUser -Username 'octocat' -Follows 'ratstallion' + ``` Checks if the user 'octocat' follows the user 'ratstallion'. diff --git a/src/functions/private/Users/GPG-Keys/Get-GitHubUserGpgKeyForUser.ps1 b/src/functions/private/Users/GPG-Keys/Get-GitHubUserGpgKeyForUser.ps1 index 826bc9d9b..25919a237 100644 --- a/src/functions/private/Users/GPG-Keys/Get-GitHubUserGpgKeyForUser.ps1 +++ b/src/functions/private/Users/GPG-Keys/Get-GitHubUserGpgKeyForUser.ps1 @@ -7,7 +7,9 @@ Lists the GPG keys for a user. This information is accessible by anyone. .EXAMPLE + ```powershell Get-GitHubUserGpgKeyForUser -Username 'octocat' + ``` Gets all GPG keys for the 'octocat' user. diff --git a/src/functions/private/Users/GPG-Keys/Get-GitHubUserMyGpgKey.ps1 b/src/functions/private/Users/GPG-Keys/Get-GitHubUserMyGpgKey.ps1 index 6b9ecbde3..d1e80d418 100644 --- a/src/functions/private/Users/GPG-Keys/Get-GitHubUserMyGpgKey.ps1 +++ b/src/functions/private/Users/GPG-Keys/Get-GitHubUserMyGpgKey.ps1 @@ -9,7 +9,9 @@ [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE + ```powershell Get-GitHubUserMyGpgKey + ``` Gets all GPG keys for the authenticated user. diff --git a/src/functions/private/Users/GPG-Keys/Get-GitHubUserMyGpgKeyById.ps1 b/src/functions/private/Users/GPG-Keys/Get-GitHubUserMyGpgKeyById.ps1 index 62594cd6e..d2cd359b5 100644 --- a/src/functions/private/Users/GPG-Keys/Get-GitHubUserMyGpgKeyById.ps1 +++ b/src/functions/private/Users/GPG-Keys/Get-GitHubUserMyGpgKeyById.ps1 @@ -9,7 +9,9 @@ [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE + ```powershell Get-GitHubUserMyGpgKeyById -ID '1234567' + ``` Gets the GPG key with ID '1234567' for the authenticated user. diff --git a/src/functions/private/Users/Get-GitHubAllUser.ps1 b/src/functions/private/Users/Get-GitHubAllUser.ps1 index 4d5f3c849..382babfbf 100644 --- a/src/functions/private/Users/Get-GitHubAllUser.ps1 +++ b/src/functions/private/Users/Get-GitHubAllUser.ps1 @@ -11,7 +11,9 @@ to get the URL for the next page of users. .EXAMPLE + ```powershell Get-GitHubAllUser -Since 17722253 + ``` Get a list of users, starting with the user 'MariusStorhaug'. diff --git a/src/functions/private/Users/Get-GitHubMyUser.ps1 b/src/functions/private/Users/Get-GitHubMyUser.ps1 index af5308aed..457231cb4 100644 --- a/src/functions/private/Users/Get-GitHubMyUser.ps1 +++ b/src/functions/private/Users/Get-GitHubMyUser.ps1 @@ -10,7 +10,9 @@ profile information. .EXAMPLE + ```powershell Get-GitHubMyUser + ``` Get the authenticated user diff --git a/src/functions/private/Users/Get-GitHubUserByName.ps1 b/src/functions/private/Users/Get-GitHubUserByName.ps1 index ae3e644af..67a3757dc 100644 --- a/src/functions/private/Users/Get-GitHubUserByName.ps1 +++ b/src/functions/private/Users/Get-GitHubUserByName.ps1 @@ -18,7 +18,9 @@ For more information, see "[Emails API](https://docs.github.com/rest/users/emails)". .EXAMPLE + ```powershell Get-GitHubUserByName -Name 'octocat' + ``` Get the 'octocat' user. diff --git a/src/functions/private/Users/Keys/Get-GitHubUserKeyForUser.ps1 b/src/functions/private/Users/Keys/Get-GitHubUserKeyForUser.ps1 index 2bab33bb4..fd4fa4e4e 100644 --- a/src/functions/private/Users/Keys/Get-GitHubUserKeyForUser.ps1 +++ b/src/functions/private/Users/Keys/Get-GitHubUserKeyForUser.ps1 @@ -7,7 +7,9 @@ Lists the _verified_ public SSH keys for a user. This is accessible by anyone. .EXAMPLE + ```powershell Get-GitHubUserKeyForUser -Username 'octocat' + ``` Gets all public SSH keys for the 'octocat' user. diff --git a/src/functions/private/Users/Keys/Get-GitHubUserMyKey.ps1 b/src/functions/private/Users/Keys/Get-GitHubUserMyKey.ps1 index 305e86323..63235c289 100644 --- a/src/functions/private/Users/Keys/Get-GitHubUserMyKey.ps1 +++ b/src/functions/private/Users/Keys/Get-GitHubUserMyKey.ps1 @@ -9,7 +9,9 @@ [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE + ```powershell Get-GitHubUserMyKey + ``` Gets all public SSH keys for the authenticated user. diff --git a/src/functions/private/Users/Keys/Get-GitHubUserMyKeyById.ps1 b/src/functions/private/Users/Keys/Get-GitHubUserMyKeyById.ps1 index 41e32fb4a..3de9268d1 100644 --- a/src/functions/private/Users/Keys/Get-GitHubUserMyKeyById.ps1 +++ b/src/functions/private/Users/Keys/Get-GitHubUserMyKeyById.ps1 @@ -9,7 +9,9 @@ [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE + ```powershell Get-GitHubUserMyKeyById -ID '1234567' + ``` Gets the public SSH key with the ID '1234567' for the authenticated user. diff --git a/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKey.ps1 b/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKey.ps1 index a74b4ea19..ff83153ec 100644 --- a/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKey.ps1 +++ b/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKey.ps1 @@ -9,7 +9,9 @@ "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." .EXAMPLE + ```powershell Get-GitHubUserMySigningKey + ``` Lists the SSH signing keys for the authenticated user's GitHub account. diff --git a/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKeyById.ps1 b/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKeyById.ps1 index c2571f0e5..6ef442b85 100644 --- a/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKeyById.ps1 +++ b/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserMySigningKeyById.ps1 @@ -10,7 +10,9 @@ "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." .EXAMPLE + ```powershell Get-GitHubUserMySigningKeyById -ID '1234567' + ``` Gets the SSH signing key with the ID '1234567' for the authenticated user. diff --git a/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserSigningKeyForUser.ps1 b/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserSigningKeyForUser.ps1 index b17735e9e..dba698853 100644 --- a/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserSigningKeyForUser.ps1 +++ b/src/functions/private/Users/SSH-Signing-Keys/Get-GitHubUserSigningKeyForUser.ps1 @@ -7,7 +7,9 @@ List SSH signing keys for a user .EXAMPLE + ```powershell Get-GitHubUserSigningKeyForUser -Username 'octocat' + ``` Gets the SSH signing keys for the user 'octocat'. diff --git a/src/functions/private/Users/Social-Accounts/Get-GitHubMyUserSocials.ps1 b/src/functions/private/Users/Social-Accounts/Get-GitHubMyUserSocials.ps1 index 1f4eee04f..663097177 100644 --- a/src/functions/private/Users/Social-Accounts/Get-GitHubMyUserSocials.ps1 +++ b/src/functions/private/Users/Social-Accounts/Get-GitHubMyUserSocials.ps1 @@ -7,7 +7,9 @@ Lists all of your social accounts. .EXAMPLE + ```powershell Get-GitHubMyUserSocials + ``` Lists all of your social accounts. diff --git a/src/functions/private/Users/Social-Accounts/Get-GitHubUserSocialsByName.ps1 b/src/functions/private/Users/Social-Accounts/Get-GitHubUserSocialsByName.ps1 index acaea233b..4f678b85e 100644 --- a/src/functions/private/Users/Social-Accounts/Get-GitHubUserSocialsByName.ps1 +++ b/src/functions/private/Users/Social-Accounts/Get-GitHubUserSocialsByName.ps1 @@ -7,7 +7,9 @@ Lists social media accounts for a user. This endpoint is accessible by anyone. .EXAMPLE + ```powershell Get-GitHubUserSocialsByName -Username 'octocat' + ``` Lists social media accounts for the user 'octocat'. diff --git a/src/functions/private/Utilities/PowerShell/Get-FunctionParameter.ps1 b/src/functions/private/Utilities/PowerShell/Get-FunctionParameter.ps1 index f67f07813..8318afa66 100644 --- a/src/functions/private/Utilities/PowerShell/Get-FunctionParameter.ps1 +++ b/src/functions/private/Utilities/PowerShell/Get-FunctionParameter.ps1 @@ -9,17 +9,23 @@ If a parameter is not provided, it will attempt to retrieve the default value. .EXAMPLE + ```powershell Get-FunctionParameter + ``` This will return all the parameters and their final value in the current function. .EXAMPLE + ```powershell Get-FunctionParameter -IncludeCommonParameters + ``` This will return all the parameters and their final value in the current function, including common parameters. .EXAMPLE + ```powershell Get-FunctionParameter -Scope 2 + ``` This will return all the parameters and their final value in the grandparent function. #> diff --git a/src/functions/private/Utilities/PowerShell/Get-PSCallStackPath.ps1 b/src/functions/private/Utilities/PowerShell/Get-PSCallStackPath.ps1 index 8fe32f238..bb1b52c59 100644 --- a/src/functions/private/Utilities/PowerShell/Get-PSCallStackPath.ps1 +++ b/src/functions/private/Utilities/PowerShell/Get-PSCallStackPath.ps1 @@ -10,21 +10,27 @@ and the last (the current function, Get-PSCallStackPath). .EXAMPLE + ```powershell Get-PSCallStackPath First-Function\Second-Function\Third-Function + ``` Shows the call stack of the last function called, Third-Function, with the first () and last (Get-PSCallStackPath) functions removed. .EXAMPLE + ```powershell Get-PSCallStackPath -SkipFirst 0 \First-Function\Second-Function\Third-Function + ``` Shows the call stack of the last function called, Third-Function, with the first function included (typically ). .EXAMPLE + ```powershell Get-PSCallStackPath -SkipLatest 0 First-Function\Second-Function\Third-Function\Get-PSCallStackPath + ``` Shows the call stack of the last function called, Third-Function, with the last function included (Get-PSCallStackPath). #> diff --git a/src/functions/private/Utilities/PowerShell/Test-GitHubAzPowerShell.ps1 b/src/functions/private/Utilities/PowerShell/Test-GitHubAzPowerShell.ps1 index 54aa9cf2c..e091b892a 100644 --- a/src/functions/private/Utilities/PowerShell/Test-GitHubAzPowerShell.ps1 +++ b/src/functions/private/Utilities/PowerShell/Test-GitHubAzPowerShell.ps1 @@ -1,4 +1,4 @@ -function Test-GitHubAzPowerShell { +function Test-GitHubAzPowerShell { <# .SYNOPSIS Tests if Azure PowerShell module is installed and authenticated. @@ -8,7 +8,9 @@ function Test-GitHubAzPowerShell { It verifies both the availability of the module and the authentication status. .EXAMPLE + ```powershell Test-GitHubAzPowerShell + ``` Returns $true if Azure PowerShell module is installed and authenticated, $false otherwise. diff --git a/src/functions/private/Utilities/PowerShell/Test-GitHubAzureCLI.ps1 b/src/functions/private/Utilities/PowerShell/Test-GitHubAzureCLI.ps1 index 19a6db1f1..571c05219 100644 --- a/src/functions/private/Utilities/PowerShell/Test-GitHubAzureCLI.ps1 +++ b/src/functions/private/Utilities/PowerShell/Test-GitHubAzureCLI.ps1 @@ -1,4 +1,4 @@ -function Test-GitHubAzureCLI { +function Test-GitHubAzureCLI { <# .SYNOPSIS Tests if Azure CLI is installed and authenticated. @@ -8,7 +8,9 @@ function Test-GitHubAzureCLI { It verifies both the availability of the CLI tool and the authentication status. .EXAMPLE + ```powershell Test-GitHubAzureCLI + ``` Returns $true if Azure CLI is installed and authenticated, $false otherwise. diff --git a/src/functions/private/Variables/Get-GitHubVariableEnvironmentByName.ps1 b/src/functions/private/Variables/Get-GitHubVariableEnvironmentByName.ps1 index 69812c051..6de91d93e 100644 --- a/src/functions/private/Variables/Get-GitHubVariableEnvironmentByName.ps1 +++ b/src/functions/private/Variables/Get-GitHubVariableEnvironmentByName.ps1 @@ -9,7 +9,9 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubVariableEnvironmentByName -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Name 'NAME' -Context $GitHubContext + ``` Output: ```powershell diff --git a/src/functions/private/Variables/Get-GitHubVariableEnvironmentList.ps1 b/src/functions/private/Variables/Get-GitHubVariableEnvironmentList.ps1 index a3241f63c..df283e97b 100644 --- a/src/functions/private/Variables/Get-GitHubVariableEnvironmentList.ps1 +++ b/src/functions/private/Variables/Get-GitHubVariableEnvironmentList.ps1 @@ -9,7 +9,9 @@ OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubVariableEnvironmentList -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Context $GitHubContext + ``` Output: ```powershell diff --git a/src/functions/private/Variables/Get-GitHubVariableFromOrganization.ps1 b/src/functions/private/Variables/Get-GitHubVariableFromOrganization.ps1 index 74b0cd0b3..26691f1dc 100644 --- a/src/functions/private/Variables/Get-GitHubVariableFromOrganization.ps1 +++ b/src/functions/private/Variables/Get-GitHubVariableFromOrganization.ps1 @@ -9,7 +9,9 @@ OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubVariableFromOrganization -Owner 'PSModule' -Repository 'GitHub' -Context (Get-GitHubContext) + ``` Output: ```powershell diff --git a/src/functions/private/Variables/Get-GitHubVariableOwnerByName.ps1 b/src/functions/private/Variables/Get-GitHubVariableOwnerByName.ps1 index a222c70d7..7cbd2204d 100644 --- a/src/functions/private/Variables/Get-GitHubVariableOwnerByName.ps1 +++ b/src/functions/private/Variables/Get-GitHubVariableOwnerByName.ps1 @@ -10,7 +10,9 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubVariableOwnerByName -Owner 'PSModule' -Name 'SELECTEDVAR' -Context (Get-GitHubContext) + ``` Output: ```powershell diff --git a/src/functions/private/Variables/Get-GitHubVariableOwnerList.ps1 b/src/functions/private/Variables/Get-GitHubVariableOwnerList.ps1 index 892ad9eff..8adff07d0 100644 --- a/src/functions/private/Variables/Get-GitHubVariableOwnerList.ps1 +++ b/src/functions/private/Variables/Get-GitHubVariableOwnerList.ps1 @@ -10,7 +10,9 @@ the `repo` scope is also required. .EXAMPLE + ```powershell Get-GitHubVariableOwnerList -Owner 'PSModule' -Context (Get-GitHubContext) + ``` Output: ```powershell diff --git a/src/functions/private/Variables/Get-GitHubVariableRepositoryByName.ps1 b/src/functions/private/Variables/Get-GitHubVariableRepositoryByName.ps1 index 20865a359..ce85ead3d 100644 --- a/src/functions/private/Variables/Get-GitHubVariableRepositoryByName.ps1 +++ b/src/functions/private/Variables/Get-GitHubVariableRepositoryByName.ps1 @@ -9,7 +9,9 @@ OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubVariableRepositoryByName -Owner 'PSModule' -Repository 'Hello-World' -Name 'EMAIL' -Context (Get-GitHubContext) + ``` Output: ```powershell diff --git a/src/functions/private/Variables/Get-GitHubVariableRepositoryList.ps1 b/src/functions/private/Variables/Get-GitHubVariableRepositoryList.ps1 index d38e51eec..c566ba02c 100644 --- a/src/functions/private/Variables/Get-GitHubVariableRepositoryList.ps1 +++ b/src/functions/private/Variables/Get-GitHubVariableRepositoryList.ps1 @@ -9,7 +9,9 @@ OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Get-GitHubVariableRepositoryList -Owner 'PSModule' -Repository 'Hello-World' -Context (Get-GitHubContext) + ``` Output: ```powershell diff --git a/src/functions/private/Variables/New-GitHubVariableOnEnvironment.ps1 b/src/functions/private/Variables/New-GitHubVariableOnEnvironment.ps1 index 8b3f764ec..9e9134db8 100644 --- a/src/functions/private/Variables/New-GitHubVariableOnEnvironment.ps1 +++ b/src/functions/private/Variables/New-GitHubVariableOnEnvironment.ps1 @@ -9,6 +9,7 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Repository = 'Hello-World' @@ -18,6 +19,7 @@ Context = $GitHubContext } New-GitHubVariableOnEnvironment @params + ``` Creates a new environment variable named `HOST_NAME` with the value `github.com` in the specified environment. diff --git a/src/functions/private/Variables/New-GitHubVariableOnOwner.ps1 b/src/functions/private/Variables/New-GitHubVariableOnOwner.ps1 index 5ba36f62e..ca6f09b79 100644 --- a/src/functions/private/Variables/New-GitHubVariableOnOwner.ps1 +++ b/src/functions/private/Variables/New-GitHubVariableOnOwner.ps1 @@ -10,7 +10,9 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell New-GitHubVariableOnOwner -Owner 'octocat' -Name 'HOST_NAME' -Value 'github.com' -Context $GitHubContext + ``` Creates a new organization variable named `HOST_NAME` with the value `github.com` in the specified organization. diff --git a/src/functions/private/Variables/New-GitHubVariableOnRepository.ps1 b/src/functions/private/Variables/New-GitHubVariableOnRepository.ps1 index 32899700f..32ce97d1f 100644 --- a/src/functions/private/Variables/New-GitHubVariableOnRepository.ps1 +++ b/src/functions/private/Variables/New-GitHubVariableOnRepository.ps1 @@ -9,7 +9,9 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell New-GitHubVariableOnRepository -Owner 'octocat' -Repository 'Hello-World' -Name 'HOST_NAME' -Value 'github.com' -Context $GitHubContext + ``` Creates a new repository variable named `HOST_NAME` with the value `github.com` in the specified repository. diff --git a/src/functions/private/Variables/Remove-GitHubVariableFromEnvironment.ps1 b/src/functions/private/Variables/Remove-GitHubVariableFromEnvironment.ps1 index f09b9fc8a..db27494ba 100644 --- a/src/functions/private/Variables/Remove-GitHubVariableFromEnvironment.ps1 +++ b/src/functions/private/Variables/Remove-GitHubVariableFromEnvironment.ps1 @@ -9,7 +9,9 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Remove-GitHubVariableFromEnvironment -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Name 'HOST_NAME' -Context $GitHubContext + ``` Deletes the specified variable from the specified environment. diff --git a/src/functions/private/Variables/Remove-GitHubVariableFromOwner.ps1 b/src/functions/private/Variables/Remove-GitHubVariableFromOwner.ps1 index 885416444..6b866e21c 100644 --- a/src/functions/private/Variables/Remove-GitHubVariableFromOwner.ps1 +++ b/src/functions/private/Variables/Remove-GitHubVariableFromOwner.ps1 @@ -10,7 +10,9 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Remove-GitHubVariableFromOwner -Owner 'octocat' -Name 'HOST_NAME' -Context $GitHubContext + ``` Deletes the specified variable from the specified organization. diff --git a/src/functions/private/Variables/Remove-GitHubVariableFromRepository.ps1 b/src/functions/private/Variables/Remove-GitHubVariableFromRepository.ps1 index 3822bb9ba..b40835171 100644 --- a/src/functions/private/Variables/Remove-GitHubVariableFromRepository.ps1 +++ b/src/functions/private/Variables/Remove-GitHubVariableFromRepository.ps1 @@ -9,7 +9,9 @@ OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Remove-GitHubVariableFromRepository -Owner 'octocat' -Repository 'Hello-World' -Name 'HOST_NAME' -Context $GitHubContext + ``` Deletes the specified variable from the specified repository. diff --git a/src/functions/private/Variables/Update-GitHubVariableOnEnvironment.ps1 b/src/functions/private/Variables/Update-GitHubVariableOnEnvironment.ps1 index 53a21c906..3125992b0 100644 --- a/src/functions/private/Variables/Update-GitHubVariableOnEnvironment.ps1 +++ b/src/functions/private/Variables/Update-GitHubVariableOnEnvironment.ps1 @@ -10,6 +10,7 @@ .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Repository = 'Hello-World' @@ -19,6 +20,7 @@ Context = $GitHubContext } Update-GitHubVariableOnEnvironment @params + ``` Updates the environment variable named `HOST_NAME` with the value `github.com` in the specified environment. diff --git a/src/functions/private/Variables/Update-GitHubVariableOnOwner.ps1 b/src/functions/private/Variables/Update-GitHubVariableOnOwner.ps1 index 3463b8b87..c39389d5d 100644 --- a/src/functions/private/Variables/Update-GitHubVariableOnOwner.ps1 +++ b/src/functions/private/Variables/Update-GitHubVariableOnOwner.ps1 @@ -10,7 +10,9 @@ the `repo` scope is also required. .EXAMPLE + ```powershell Update-GitHubVariableOnOwner -Owner 'octocat' -Name 'HOST_NAME' -Value 'github.com' -Context $GitHubContext + ``` Updates the organization variable named `HOST_NAME` with the value `github.com` in the specified organization. diff --git a/src/functions/private/Variables/Update-GitHubVariableOnRepository.ps1 b/src/functions/private/Variables/Update-GitHubVariableOnRepository.ps1 index d35bd664e..a737ccded 100644 --- a/src/functions/private/Variables/Update-GitHubVariableOnRepository.ps1 +++ b/src/functions/private/Variables/Update-GitHubVariableOnRepository.ps1 @@ -9,7 +9,9 @@ OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Update-GitHubVariableOnRepository -Owner 'octocat' -Repository 'Hello-World' -Name 'HOST_NAME' -Value 'github.com' -Context $GitHubContext + ``` Updates the repository variable named `HOST_NAME` with the value `github.com` in the specified repository. diff --git a/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryByID.ps1 b/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryByID.ps1 index a9aab7b78..2694e3361 100644 --- a/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryByID.ps1 +++ b/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryByID.ps1 @@ -11,7 +11,9 @@ .EXAMPLE + ```powershell Get-GitHubAppWebhookDeliveryByID -ID 123456 + ``` Returns the webhook configuration for the authenticated app. diff --git a/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryByList.ps1 b/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryByList.ps1 index 8f0dac867..64c9b68c4 100644 --- a/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryByList.ps1 +++ b/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryByList.ps1 @@ -10,7 +10,9 @@ to access this endpoint. .EXAMPLE + ```powershell Get-GitHubAppWebhookDeliveryByList + ``` Returns the webhook configuration for the authenticated app. diff --git a/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryToRedeliver.ps1 b/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryToRedeliver.ps1 index 957dad479..8d85ae38f 100644 --- a/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryToRedeliver.ps1 +++ b/src/functions/private/Webhooks/Get-GitHubAppWebhookDeliveryToRedeliver.ps1 @@ -7,7 +7,9 @@ Long description .EXAMPLE + ```powershell An example + ``` .NOTES [Ttle](link) diff --git a/src/functions/public/API/Invoke-GitHubAPI.ps1 b/src/functions/public/API/Invoke-GitHubAPI.ps1 index 2c4d9279b..8bae373aa 100644 --- a/src/functions/public/API/Invoke-GitHubAPI.ps1 +++ b/src/functions/public/API/Invoke-GitHubAPI.ps1 @@ -11,17 +11,23 @@ function Invoke-GitHubAPI { It automatically handles the endpoint URI construction, headers, and token authentication. .EXAMPLE + ```powershell Invoke-GitHubAPI -ApiEndpoint '/repos/user/repo/pulls' -Method GET + ``` Gets all open pull requests for the specified repository. .EXAMPLE + ```powershell Invoke-GitHubAPI -ApiEndpoint '/repos/user/repo/pulls' -Method GET -Body @{ state = 'open' } + ``` Gets all open pull requests for the specified repository, filtered by the 'state' parameter. .EXAMPLE + ```powershell Invoke-GitHubAPI -ApiEndpoint '/repos/user/repo/pulls' -Method GET -Body @{ state = 'open' } -Accept 'application/vnd.github.v3+json' + ``` Gets all open pull requests for the specified repository, filtered by the 'state' parameter, and using the specified 'Accept' header. diff --git a/src/functions/public/API/Invoke-GitHubGraphQLQuery.ps1 b/src/functions/public/API/Invoke-GitHubGraphQLQuery.ps1 index 6da9cd426..23f181675 100644 --- a/src/functions/public/API/Invoke-GitHubGraphQLQuery.ps1 +++ b/src/functions/public/API/Invoke-GitHubGraphQLQuery.ps1 @@ -7,7 +7,9 @@ Use this function to invoke a GraphQL query and mutations against the GitHub GraphQL API with proper error handling. .EXAMPLE + ```powershell Invoke-GitHubGraphQLQuery -Query $query -Variables $Variables + ``` .LINK https://psmodule.io/GitHub/Functions/API/Invoke-GitHubGraphQLQuery diff --git a/src/functions/public/Actions/Data/Get-GitHubEventData.ps1 b/src/functions/public/Actions/Data/Get-GitHubEventData.ps1 index 1bfedf23f..be4e689cc 100644 --- a/src/functions/public/Actions/Data/Get-GitHubEventData.ps1 +++ b/src/functions/public/Actions/Data/Get-GitHubEventData.ps1 @@ -7,7 +7,9 @@ Gets data about the event that triggered the workflow. .EXAMPLE + ```powershell Get-GitHubEventData + ``` .LINK https://psmodule.io/GitHub/Functions/Actions/Data/Get-GitHubEventData diff --git a/src/functions/public/Actions/Data/Get-GitHubRunnerData.ps1 b/src/functions/public/Actions/Data/Get-GitHubRunnerData.ps1 index 896d058e8..9f83de10a 100644 --- a/src/functions/public/Actions/Data/Get-GitHubRunnerData.ps1 +++ b/src/functions/public/Actions/Data/Get-GitHubRunnerData.ps1 @@ -7,7 +7,9 @@ Gets data about the runner thats running the workflow. .EXAMPLE + ```powershell Get-GitHubRunnerData + ``` .LINK https://psmodule.io/GitHub/Functions/Actions/Data/Get-GitHubRunnerData diff --git a/src/functions/public/Apps/GitHub App Installations/Add-GitHubAppInstallationRepositoryAccess.ps1 b/src/functions/public/Apps/GitHub App Installations/Add-GitHubAppInstallationRepositoryAccess.ps1 index b447032cb..9fd392d22 100644 --- a/src/functions/public/Apps/GitHub App Installations/Add-GitHubAppInstallationRepositoryAccess.ps1 +++ b/src/functions/public/Apps/GitHub App Installations/Add-GitHubAppInstallationRepositoryAccess.ps1 @@ -7,6 +7,7 @@ Grant repository access to an organization installation. .EXAMPLE + ```powershell $params = @{ Enterprise = 'msx' Organization = 'PSModule' @@ -14,6 +15,7 @@ Repositories = 'repo1', 'repo2' } Add-GitHubAppInstallationRepositoryAccess @params + ``` Grant access to the repositories 'repo1' and 'repo2' for the installation with the ID '12345678' on the organization 'PSModule' in the enterprise 'msx'. diff --git a/src/functions/public/Apps/GitHub App Installations/Get-GitHubAppAccessibleRepository.ps1 b/src/functions/public/Apps/GitHub App Installations/Get-GitHubAppAccessibleRepository.ps1 index a884c9083..3af8b5b56 100644 --- a/src/functions/public/Apps/GitHub App Installations/Get-GitHubAppAccessibleRepository.ps1 +++ b/src/functions/public/Apps/GitHub App Installations/Get-GitHubAppAccessibleRepository.ps1 @@ -11,11 +11,13 @@ permission. .EXAMPLE + ```powershell $params = @{ Enterprise = 'msx' Organization = 'PSModule' } Get-GitHubAppAccessibleRepository @params + ``` Get the repositories that can be made accessible to a GitHub App installed on the organization 'PSModule' in the enterprise 'msx'. diff --git a/src/functions/public/Apps/GitHub App Installations/Get-GitHubAppInstallationRepositoryAccess.ps1 b/src/functions/public/Apps/GitHub App Installations/Get-GitHubAppInstallationRepositoryAccess.ps1 index 0c6423e19..19bc79533 100644 --- a/src/functions/public/Apps/GitHub App Installations/Get-GitHubAppInstallationRepositoryAccess.ps1 +++ b/src/functions/public/Apps/GitHub App Installations/Get-GitHubAppInstallationRepositoryAccess.ps1 @@ -9,12 +9,14 @@ The authenticated GitHub App must be installed on the enterprise and be granted the Enterprise/organization_installations (read) permission. .EXAMPLE + ```powershell $params = @{ Enterprise = 'msx' Organization = 'PSModule' InstallationID = 12345678 } Get-GitHubAppInstallationRepositoryAccess @params + ``` Get the repositories accessible to the GitHub App installation with the ID '12345678' on the organization 'PSModule' in the enterprise 'msx'. diff --git a/src/functions/public/Apps/GitHub App Installations/New-GitHubAppInstallationAccessToken.ps1 b/src/functions/public/Apps/GitHub App Installations/New-GitHubAppInstallationAccessToken.ps1 index 142f8370a..0ffda1302 100644 --- a/src/functions/public/Apps/GitHub App Installations/New-GitHubAppInstallationAccessToken.ps1 +++ b/src/functions/public/Apps/GitHub App Installations/New-GitHubAppInstallationAccessToken.ps1 @@ -28,13 +28,17 @@ to access this endpoint. .EXAMPLE + ```powershell New-GitHubAppInstallationAccessToken -InstallationID 12345678 + ``` Creates an installation access token for the installation with the ID `12345678`. .EXAMPLE + ```powershell Connect-GitHub -ClientID $ClientID -PrivateKey $PrivateKey Get-GitHubAppInstallation | New-GitHubAppInstallationAccessToken + ``` Gets the GitHub App installations and creates an installation access token for each installation. diff --git a/src/functions/public/Apps/GitHub App Installations/Remove-GitHubAppInstallationRepositoryAccess.ps1 b/src/functions/public/Apps/GitHub App Installations/Remove-GitHubAppInstallationRepositoryAccess.ps1 index 9c604ab1b..82b76c55f 100644 --- a/src/functions/public/Apps/GitHub App Installations/Remove-GitHubAppInstallationRepositoryAccess.ps1 +++ b/src/functions/public/Apps/GitHub App Installations/Remove-GitHubAppInstallationRepositoryAccess.ps1 @@ -7,6 +7,7 @@ Remove repository access to an organization installation. .EXAMPLE + ```powershell $params = @{ Enterprise = 'msx' Organization = 'PSModule' @@ -14,6 +15,7 @@ Repositories = 'repo1', 'repo2' } Remove-GitHubAppInstallationRepositoryAccess @params + ``` Remove access to the repositories 'repo1' and 'repo2' for the installation with the ID '12345678' on the organization 'PSModule' in the enterprise 'msx'. diff --git a/src/functions/public/Apps/GitHub App Installations/Update-GitHubAppInstallationRepositoryAccess.ps1 b/src/functions/public/Apps/GitHub App Installations/Update-GitHubAppInstallationRepositoryAccess.ps1 index 58111e114..0494dcdc8 100644 --- a/src/functions/public/Apps/GitHub App Installations/Update-GitHubAppInstallationRepositoryAccess.ps1 +++ b/src/functions/public/Apps/GitHub App Installations/Update-GitHubAppInstallationRepositoryAccess.ps1 @@ -7,12 +7,15 @@ Update repository access for a GitHub App installation between all repositories and selected repositories. .EXAMPLE + ```powershell Update-GitHubAppInstallationRepositoryAccess -Enterprise 'msx' -Organization 'PSModule' -InstallationID 12345678 -RepositorySelection 'all' + ``` Update the repository access for the GitHub App installation with the ID '12345678' to all repositories on the organization 'PSModule' in the enterprise 'msx'. .EXAMPLE + ```powershell $params = @{ Enterprise = 'msx' Organization = 'PSModule' @@ -21,6 +24,7 @@ Repositories = 'repo1', 'repo2' } Update-GitHubAppInstallationRepositoryAccess @params + ``` Update the repository access for the GitHub App installation with the ID '12345678' to the repositories 'repo1' and 'repo2' on the organization 'PSModule' in the enterprise 'msx'. diff --git a/src/functions/public/Apps/GitHub App/Get-GitHubApp.ps1 b/src/functions/public/Apps/GitHub App/Get-GitHubApp.ps1 index 521168d95..f40115499 100644 --- a/src/functions/public/Apps/GitHub App/Get-GitHubApp.ps1 +++ b/src/functions/public/Apps/GitHub App/Get-GitHubApp.ps1 @@ -7,12 +7,16 @@ Returns a GitHub App associated with the authentication credentials used or the provided app-slug. .EXAMPLE + ```powershell Get-GitHubApp + ``` Get the authenticated app. .EXAMPLE + ```powershell Get-GitHubApp -Slug 'github-actions' + ``` Get the GitHub App with the slug 'github-actions'. diff --git a/src/functions/public/Apps/GitHub App/Get-GitHubAppInstallationRequest.ps1 b/src/functions/public/Apps/GitHub App/Get-GitHubAppInstallationRequest.ps1 index 7f9da82ce..7ecbe0a42 100644 --- a/src/functions/public/Apps/GitHub App/Get-GitHubAppInstallationRequest.ps1 +++ b/src/functions/public/Apps/GitHub App/Get-GitHubAppInstallationRequest.ps1 @@ -7,7 +7,9 @@ Lists all the pending installation requests for the authenticated GitHub App. .EXAMPLE + ```powershell Get-GitHubAppInstallationRequest + ``` Lists all the pending installation requests for the authenticated GitHub App. diff --git a/src/functions/public/Apps/GitHub App/Install-GitHubApp.ps1 b/src/functions/public/Apps/GitHub App/Install-GitHubApp.ps1 index d30dafe98..9617a316f 100644 --- a/src/functions/public/Apps/GitHub App/Install-GitHubApp.ps1 +++ b/src/functions/public/Apps/GitHub App/Install-GitHubApp.ps1 @@ -7,7 +7,9 @@ Installs the provided GitHub App on the specified target. .EXAMPLE + ```powershell Install-GitHubApp -Enterprise 'msx' -Organization 'org' -ClientID '123456' -RepositorySelection 'selected' -Repositories 'repo1', 'repo2' + ``` Install the GitHub App with - the client ID '123456' @@ -16,7 +18,9 @@ on the organization 'org' in the enterprise 'msx'. .EXAMPLE + ```powershell Install-GitHubApp -Enterprise 'msx' -Organization 'org' -ClientID '123456' -RepositorySelection 'all' + ``` Install the GitHub App with - the client ID '123456' diff --git a/src/functions/public/Apps/GitHub App/Uninstall-GitHubApp.ps1 b/src/functions/public/Apps/GitHub App/Uninstall-GitHubApp.ps1 index 252ac503e..613d2f3cf 100644 --- a/src/functions/public/Apps/GitHub App/Uninstall-GitHubApp.ps1 +++ b/src/functions/public/Apps/GitHub App/Uninstall-GitHubApp.ps1 @@ -9,23 +9,31 @@ - As an enterprise installation (IAT/UAT context with Enterprise): remove an app from an organization by InstallationID or AppSlug. .EXAMPLE + ```powershell Uninstall-GitHubApp -Target 'octocat' Uninstall-GitHubApp -Target 12345 + ``` As an App: uninstall by target name (enterprise/org/user) or by exact installation ID .EXAMPLE + ```powershell Get-GitHubAppInstallation | Uninstall-GitHubApp + ``` As an App: uninstall using pipeline objects .EXAMPLE + ```powershell Uninstall-GitHubApp -Organization 'org' -InstallationID 123456 -Context (Connect-GitHubApp -Enterprise 'msx' -PassThru) + ``` As an enterprise installation: uninstall by installation ID in an org .EXAMPLE + ```powershell Uninstall-GitHubApp -Organization 'org' -AppSlug 'my-app' -Context (Connect-GitHubApp -Enterprise 'msx' -PassThru) + ``` As an enterprise installation: uninstall by app slug in an org diff --git a/src/functions/public/Artifacts/Get-GitHubArtifact.ps1 b/src/functions/public/Artifacts/Get-GitHubArtifact.ps1 index a7657facc..78c8a9dde 100644 --- a/src/functions/public/Artifacts/Get-GitHubArtifact.ps1 +++ b/src/functions/public/Artifacts/Get-GitHubArtifact.ps1 @@ -12,7 +12,9 @@ - FromRepository: Retrieve artifacts from a repository, optionally by name or with all versions. .EXAMPLE + ```powershell Get-GitHubArtifact -Owner 'octocat' -Repository 'Hello-World' -ID '123456' + ``` Output: ```powershell @@ -25,7 +27,9 @@ Retrieves a single GitHub Actions artifact using its unique artifact ID. .EXAMPLE + ```powershell Get-GitHubArtifact -Owner 'octocat' -Repository 'Hello-World' -WorkflowRunID '987654321' + ``` Output: ```powershell @@ -38,7 +42,9 @@ Retrieves the latest version of all artifacts from the specified workflow run. .EXAMPLE + ```powershell Get-GitHubArtifact -Owner 'octocat' -Repository 'Hello-World' -WorkflowRunID '987654321' -AllVersions + ``` Output: ```powershell @@ -56,7 +62,9 @@ Retrieves all versions of all artifacts from the specified workflow run. .EXAMPLE + ```powershell Get-GitHubArtifact -Owner 'octocat' -Repository 'Hello-World' + ``` Output: ```powershell diff --git a/src/functions/public/Artifacts/Remove-GitHubArtifact.ps1 b/src/functions/public/Artifacts/Remove-GitHubArtifact.ps1 index 747d32150..bbb26b598 100644 --- a/src/functions/public/Artifacts/Remove-GitHubArtifact.ps1 +++ b/src/functions/public/Artifacts/Remove-GitHubArtifact.ps1 @@ -1,4 +1,4 @@ -function Remove-GitHubArtifact { +function Remove-GitHubArtifact { <# .SYNOPSIS Deletes an artifact from a GitHub repository by its unique ID. @@ -10,7 +10,9 @@ function Remove-GitHubArtifact { The function uses the GitHub REST API to perform the deletion and supports `ShouldProcess` for safe execution. .EXAMPLE + ```powershell Remove-GitHubArtifact -Owner 'octocat' -Repository 'demo-repo' -ID '123456' + ``` Deletes the artifact with ID 123456 from the repository 'demo-repo' owned by 'octocat'. diff --git a/src/functions/public/Artifacts/Save-GitHubArtifact.ps1 b/src/functions/public/Artifacts/Save-GitHubArtifact.ps1 index 6c34f001d..70df4b857 100644 --- a/src/functions/public/Artifacts/Save-GitHubArtifact.ps1 +++ b/src/functions/public/Artifacts/Save-GitHubArtifact.ps1 @@ -9,7 +9,9 @@ personal access tokens (classic) or OAuth tokens with the `repo` scope are required. .EXAMPLE + ```powershell Save-GitHubArtifact -Owner 'octocat' -Repository 'Hello-World' -ID '123456' -Path 'C:\Artifacts' + ``` Output: ```powershell @@ -23,7 +25,9 @@ Downloads artifact ID '123456' from the 'Hello-World' repository owned by 'octocat' to the specified path. .EXAMPLE + ```powershell Save-GitHubArtifact -Owner 'octocat' -Repository 'Hello-World' -Name 'module' -Path 'C:\Artifacts\module' -Expand -Force + ``` Output: ```powershell diff --git a/src/functions/public/Auth/Connect-GitHubAccount.ps1 b/src/functions/public/Auth/Connect-GitHubAccount.ps1 index 8a371a922..03b9e7ffa 100644 --- a/src/functions/public/Auth/Connect-GitHubAccount.ps1 +++ b/src/functions/public/Auth/Connect-GitHubAccount.ps1 @@ -17,26 +17,34 @@ the app will be able to make API calls with a new access token. .EXAMPLE + ```powershell Connect-GitHubAccount + ``` Connects to GitHub using a device flow login. If the user has already logged in, the access token will be refreshed. .EXAMPLE + ```powershell $env:GH_TOKEN = '***' Connect-GitHubAccount + ``` Connects to GitHub using the access token from environment variable, assuming unattended mode. .EXAMPLE + ```powershell Connect-GitHubAccount -UseAccessToken ! Enter your personal access token: ************* + ``` User gets prompted for the access token and stores it in the context. The token is used when connecting to GitHub. .EXAMPLE + ```powershell Connect-GitHubAccount -Mode 'OAuthApp' -Scope 'gist read:org repo workflow' + ``` Connects to GitHub using a device flow login and sets the scope of the access token. diff --git a/src/functions/public/Auth/Connect-GitHubApp.ps1 b/src/functions/public/Auth/Connect-GitHubApp.ps1 index cb54b8513..e6c6adda5 100644 --- a/src/functions/public/Auth/Connect-GitHubApp.ps1 +++ b/src/functions/public/Auth/Connect-GitHubApp.ps1 @@ -12,22 +12,30 @@ - Enterprise .EXAMPLE + ```powershell Connect-GitHubApp + ``` Connects to GitHub as all available targets using the logged in GitHub App. .EXAMPLE + ```powershell Connect-GitHubApp -User 'octocat' + ``` Connects to GitHub as the user 'octocat' using the logged in GitHub App. .EXAMPLE + ```powershell Connect-GitHubApp -Organization 'psmodule' -Default + ``` Connects to GitHub as the organization 'psmodule' using the logged in GitHub App and sets it as the default context. .EXAMPLE + ```powershell Connect-GitHubApp -Enterprise 'msx' + ``` Connects to GitHub as the enterprise 'msx' using the logged in GitHub App. diff --git a/src/functions/public/Auth/Context/Get-GitHubContext.ps1 b/src/functions/public/Auth/Context/Get-GitHubContext.ps1 index 03ff7be82..0357b7bed 100644 --- a/src/functions/public/Auth/Context/Get-GitHubContext.ps1 +++ b/src/functions/public/Auth/Context/Get-GitHubContext.ps1 @@ -7,7 +7,9 @@ Get the current GitHub context. .EXAMPLE + ```powershell Get-GitHubContext + ``` Gets the current GitHub context. diff --git a/src/functions/public/Auth/Context/Switch-GitHubContext.ps1 b/src/functions/public/Auth/Context/Switch-GitHubContext.ps1 index b4f7ed876..f85281b1b 100644 --- a/src/functions/public/Auth/Context/Switch-GitHubContext.ps1 +++ b/src/functions/public/Auth/Context/Switch-GitHubContext.ps1 @@ -7,7 +7,9 @@ Set the default context for the GitHub module. .EXAMPLE + ```powershell Switch-GitHubContext -Context 'github.com/Octocat' + ``` .LINK https://psmodule.io/GitHub/Functions/Auth/Context/Switch-GitHubContext diff --git a/src/functions/public/Auth/Disconnect-GitHubAccount.ps1 b/src/functions/public/Auth/Disconnect-GitHubAccount.ps1 index 32ce7a61a..810bbc9cd 100644 --- a/src/functions/public/Auth/Disconnect-GitHubAccount.ps1 +++ b/src/functions/public/Auth/Disconnect-GitHubAccount.ps1 @@ -8,22 +8,30 @@ to ensure it cannot be used after disconnection. .EXAMPLE + ```powershell Disconnect-GitHubAccount + ``` Disconnects from GitHub and removes the default GitHub context. .EXAMPLE + ```powershell Disconnect-GithubAccount -Context 'github.com/Octocat' + ``` Disconnects from GitHub and removes the context 'github.com/Octocat'. .EXAMPLE + ```powershell Disconnect-GitHubAccount -RevokeToken + ``` Disconnects from GitHub, revokes the access token, and removes the default GitHub context. .EXAMPLE + ```powershell Disconnect-GithubAccount -Context 'github.com/Octocat' -RevokeToken + ``` Disconnects from GitHub, revokes the access token, and removes the context 'github.com/Octocat'. diff --git a/src/functions/public/Auth/Get-GitHubAccessToken.ps1 b/src/functions/public/Auth/Get-GitHubAccessToken.ps1 index 97ead7bfa..275c28873 100644 --- a/src/functions/public/Auth/Get-GitHubAccessToken.ps1 +++ b/src/functions/public/Auth/Get-GitHubAccessToken.ps1 @@ -10,7 +10,9 @@ Use this function to extract authentication tokens for subsequent API requests. .EXAMPLE + ```powershell Get-GitHubAccessToken + ``` Output: ```powershell @@ -20,7 +22,9 @@ Retrieves the access token from the default context as a secure string. .EXAMPLE + ```powershell Get-GitHubAccessToken -Context $myGitHubContext -AsPlainText + ``` Output: ```powershell diff --git a/src/functions/public/Auth/Get-GitHubViewer.ps1 b/src/functions/public/Auth/Get-GitHubViewer.ps1 index f5088adb9..02573faf6 100644 --- a/src/functions/public/Auth/Get-GitHubViewer.ps1 +++ b/src/functions/public/Auth/Get-GitHubViewer.ps1 @@ -7,7 +7,9 @@ Gets the currently authenticated user. .EXAMPLE + ```powershell Get-GithubViewer + ``` Gets the currently authenticated user. diff --git a/src/functions/public/Commands/Add-GitHubMask.ps1 b/src/functions/public/Commands/Add-GitHubMask.ps1 index faa80491e..dc6ecef64 100644 --- a/src/functions/public/Commands/Add-GitHubMask.ps1 +++ b/src/functions/public/Commands/Add-GitHubMask.ps1 @@ -10,12 +10,16 @@ set that value as an output. .EXAMPLE + ```powershell Add-Mask $SecretValue + ``` Masks the value of $SecretValue so that its printed like ***. .EXAMPLE + ```powershell $SecretValue1, $SecretValue2 | Mask + ``` Masks the value of $SecretValue1 and $SecretValue2 so that its printed like ***, using the pipeline diff --git a/src/functions/public/Commands/Add-GitHubSystemPath.ps1 b/src/functions/public/Commands/Add-GitHubSystemPath.ps1 index 43ac36e1b..02968ff9c 100644 --- a/src/functions/public/Commands/Add-GitHubSystemPath.ps1 +++ b/src/functions/public/Commands/Add-GitHubSystemPath.ps1 @@ -9,7 +9,9 @@ echo "$env:PATH" in a step or an action. .EXAMPLE + ```powershell Add-GitHubSystemPath -Path '$HOME/.local/bin' + ``` .NOTES [Adding a system path](https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path) diff --git a/src/functions/public/Commands/Disable-GitHubCommand.ps1 b/src/functions/public/Commands/Disable-GitHubCommand.ps1 index edcbdefc3..c2b22072b 100644 --- a/src/functions/public/Commands/Disable-GitHubCommand.ps1 +++ b/src/functions/public/Commands/Disable-GitHubCommand.ps1 @@ -11,7 +11,9 @@ that you used to stop workflow commands to the Enable-GitHubCommand. .EXAMPLE + ```powershell Disable-GitHubCommand "123" + ``` Stops processing any workflow commands. diff --git a/src/functions/public/Commands/Enable-GitHubCommand.ps1 b/src/functions/public/Commands/Enable-GitHubCommand.ps1 index b98b88a7b..ecb92949c 100644 --- a/src/functions/public/Commands/Enable-GitHubCommand.ps1 +++ b/src/functions/public/Commands/Enable-GitHubCommand.ps1 @@ -10,7 +10,9 @@ that you used to stop workflow commands to the Enable-GitHubCommand. .EXAMPLE + ```powershell Enable-GitHubCommand "123" + ``` Resumes processing any workflow commands. diff --git a/src/functions/public/Commands/Get-GitHubOutput.ps1 b/src/functions/public/Commands/Get-GitHubOutput.ps1 index f98bd00d9..8fad3798c 100644 --- a/src/functions/public/Commands/Get-GitHubOutput.ps1 +++ b/src/functions/public/Commands/Get-GitHubOutput.ps1 @@ -7,15 +7,19 @@ Gets the GitHub output from $env:GITHUB_OUTPUT and creates an object with key-value pairs, supporting both single-line and multi-line values .EXAMPLE + ```powershell Get-GitHubOutput MY_VALUE result zen -------- ------ --- qwe… @{"MyOutput":"Hello, World!"} something else + ``` Gets the GitHub output and returns an object with key-value pairs. .EXAMPLE + ```powershell Get-GitHubOutput -AsHashtable + ``` Name Value ---- ----- diff --git a/src/functions/public/Commands/Reset-GitHubOutput.ps1 b/src/functions/public/Commands/Reset-GitHubOutput.ps1 index 3d96eaa4d..dc148c397 100644 --- a/src/functions/public/Commands/Reset-GitHubOutput.ps1 +++ b/src/functions/public/Commands/Reset-GitHubOutput.ps1 @@ -7,7 +7,9 @@ Resets the GitHub output by clearing the contents of $env:GITHUB_OUTPUT. .EXAMPLE + ```powershell Reset-GitHubOutput + ``` Resets the content in the GitHub output file. diff --git a/src/functions/public/Commands/Set-GitHubEnvironmentVariable.ps1 b/src/functions/public/Commands/Set-GitHubEnvironmentVariable.ps1 index db103b5f7..88c994302 100644 --- a/src/functions/public/Commands/Set-GitHubEnvironmentVariable.ps1 +++ b/src/functions/public/Commands/Set-GitHubEnvironmentVariable.ps1 @@ -7,7 +7,9 @@ Set a GitHub environment variable .EXAMPLE + ```powershell Set-GitHubEnv -Name 'MyVariable' -Value 'MyValue' + ``` .NOTES [Setting an environment variable](https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable) diff --git a/src/functions/public/Commands/Set-GitHubLogGroup.ps1 b/src/functions/public/Commands/Set-GitHubLogGroup.ps1 index 0031282de..0af48b24d 100644 --- a/src/functions/public/Commands/Set-GitHubLogGroup.ps1 +++ b/src/functions/public/Commands/Set-GitHubLogGroup.ps1 @@ -8,16 +8,20 @@ Allows for colapsing of code in IDE for code that belong together. .EXAMPLE + ```powershell Set-GitHubLogGroup -Name 'MyGroup' -ScriptBlock { Write-Host 'Hello, World!' } + ``` Creates a new log group named 'MyGroup' and writes 'Hello, World!' to the output. .EXAMPLE + ```powershell LogGroup 'MyGroup' { Write-Host 'Hello, World!' } + ``` Uses the alias 'LogGroup' to create a new log group named 'MyGroup' and writes 'Hello, World!' to the output. diff --git a/src/functions/public/Commands/Set-GitHubNoCommandGroup.ps1 b/src/functions/public/Commands/Set-GitHubNoCommandGroup.ps1 index 44282f5b0..91b32e07f 100644 --- a/src/functions/public/Commands/Set-GitHubNoCommandGroup.ps1 +++ b/src/functions/public/Commands/Set-GitHubNoCommandGroup.ps1 @@ -8,18 +8,22 @@ Allows for colapsing of code in IDE for code that belong together. .EXAMPLE + ```powershell Set-GitHubNoCommandGroup { Write-Host 'Hello, World!' Write-GithubError 'This is an error' } + ``` Groups commands where no workflow commands are run. .EXAMPLE + ```powershell NoLogGroup 'MyGroup' { Write-Host 'Hello, World!' Write-GithubError 'This is an error' } + ``` Groups commands where no workflow commands are run, using an alias and DSL approach. diff --git a/src/functions/public/Commands/Set-GitHubOutput.ps1 b/src/functions/public/Commands/Set-GitHubOutput.ps1 index 228b415fe..42b5d2ad6 100644 --- a/src/functions/public/Commands/Set-GitHubOutput.ps1 +++ b/src/functions/public/Commands/Set-GitHubOutput.ps1 @@ -13,15 +13,19 @@ The Value parameter accepts null values, which will be correctly preserved and set as the output. .EXAMPLE + ```powershell Set-GitHubOutput -Name 'ID' -Value '123123123' + ``` Sets the output variable 'ID' to '123123123' in the GitHub Actions output file. .EXAMPLE + ```powershell Set-GitHubOutput -Name 'result' -Value @{ ID = '123123123' name = 'test' } + ``` .LINK https://psmodule.io/GitHub/Functions/Commands/Set-GitHubOutput diff --git a/src/functions/public/Commands/Set-GitHubStepSummary.ps1 b/src/functions/public/Commands/Set-GitHubStepSummary.ps1 index 597b79e30..5ade7672b 100644 --- a/src/functions/public/Commands/Set-GitHubStepSummary.ps1 +++ b/src/functions/public/Commands/Set-GitHubStepSummary.ps1 @@ -16,7 +16,9 @@ workflow run summary page. If multiple jobs generate summaries, the job summaries are ordered by job completion time. .EXAMPLE + ```powershell Set-GitHubStepSummary -Summary 'Hello, World!' + ``` .NOTES [Adding a job summary](https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions?utm_source=chatgpt.com#adding-a-job-summary) diff --git a/src/functions/public/Commands/Start-GitHubLogGroup.ps1 b/src/functions/public/Commands/Start-GitHubLogGroup.ps1 index a7e722f7d..8682bced8 100644 --- a/src/functions/public/Commands/Start-GitHubLogGroup.ps1 +++ b/src/functions/public/Commands/Start-GitHubLogGroup.ps1 @@ -3,16 +3,41 @@ .SYNOPSIS Starts a log group in GitHub Actions + .DESCRIPTION + Creates an expandable group in the GitHub Actions log. Anything you print to the log between the + `Start-GitHubLogGroup` and `Stop-GitHubLogGroup` commands will be nested inside an expandable entry in the log. + This is useful for organizing long log outputs and making them more readable. + + This function only has an effect when running in a GitHub Actions workflow (when $env:GITHUB_ACTIONS is 'true'). + When run outside of GitHub Actions, it does nothing. + + This corresponds to the `::group::{title}` workflow command in GitHub Actions. + .EXAMPLE - New-LogGroup 'MyGroup' + ```powershell + Start-GitHubLogGroup 'MyGroup' + ``` - Starts a new log group named 'MyGroup' + Starts a new log group named 'MyGroup'. All subsequent log output will be grouped under this expandable section + until Stop-GitHubLogGroup is called. - .NOTES - [GitHub - Grouping log lines](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines) + .EXAMPLE + ```powershell + Start-GitHubLogGroup 'Building application' + Write-Host 'Step 1: Restoring packages' + Write-Host 'Step 2: Compiling code' + Write-Host 'Step 3: Running tests' + Stop-GitHubLogGroup + ``` + + Creates a collapsible log group containing the build steps. The output will appear nested under the + "Building application" header in the GitHub Actions log. .LINK https://psmodule.io/GitHub/Functions/Commands/Start-GitHubLogGroup + + .NOTES + [Workflow commands](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines) #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', @@ -25,7 +50,8 @@ [CmdletBinding()] [Alias('Start-LogGroup')] param( - # The name of the log group + # The title of the log group. + # This will be displayed as the header of the expandable group in the GitHub Actions log. [Parameter(Mandatory)] [string] $Name ) diff --git a/src/functions/public/Commands/Stop-GitHubLogGroup.ps1 b/src/functions/public/Commands/Stop-GitHubLogGroup.ps1 index 7e185271f..9440769b2 100644 --- a/src/functions/public/Commands/Stop-GitHubLogGroup.ps1 +++ b/src/functions/public/Commands/Stop-GitHubLogGroup.ps1 @@ -3,16 +3,39 @@ .SYNOPSIS Stops the current log group in GitHub Actions + .DESCRIPTION + Ends the expandable group in the GitHub Actions log that was started with `Start-GitHubLogGroup`. + All log output after this command will no longer be nested within the group. + + This function only has an effect when running in a GitHub Actions workflow (when $env:GITHUB_ACTIONS is 'true'). + When run outside of GitHub Actions, it does nothing. + + This corresponds to the `::endgroup::` workflow command in GitHub Actions. + .EXAMPLE - Stop-LogGroup + ```powershell + Stop-GitHubLogGroup + ``` - Starts a new log group named 'MyGroup' + Stops the current log group in GitHub Actions. - .NOTES - [GitHub - Grouping log lines](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines) + .EXAMPLE + ```powershell + Start-GitHubLogGroup 'Deployment Steps' + Write-Host 'Deploying to staging...' + Write-Host 'Deployment complete' + Stop-GitHubLogGroup + Write-Host 'This output is not in the group' + ``` + + Creates a log group for deployment steps. The final Write-Host command outputs text outside of the group + since Stop-GitHubLogGroup was called. .LINK https://psmodule.io/GitHub/Functions/Commands/Stop-GitHubLogGroup + + .NOTES + [Workflow commands](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines) #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', diff --git a/src/functions/public/Commands/Write-GitHubDebug.ps1 b/src/functions/public/Commands/Write-GitHubDebug.ps1 index d6dfd3fc2..3d6c14f3c 100644 --- a/src/functions/public/Commands/Write-GitHubDebug.ps1 +++ b/src/functions/public/Commands/Write-GitHubDebug.ps1 @@ -11,7 +11,9 @@ If both the secret and variable are set, the value of the secret takes precedence over the variable. .EXAMPLE + ```powershell Write-GitHubDebug -Message 'Hello, World!' + ``` Writes a debug message 'Hello, World!'. diff --git a/src/functions/public/Commands/Write-GitHubError.ps1 b/src/functions/public/Commands/Write-GitHubError.ps1 index 9b78d8889..3fe65ad7d 100644 --- a/src/functions/public/Commands/Write-GitHubError.ps1 +++ b/src/functions/public/Commands/Write-GitHubError.ps1 @@ -7,7 +7,9 @@ Write a error message in GitHub Actions. The message will be displayed in the GitHub Actions log. .EXAMPLE + ```powershell Write-GitHubError -Message 'Hello, World!' + ``` Writes a error message 'Hello, World!'. diff --git a/src/functions/public/Commands/Write-GitHubLog.ps1 b/src/functions/public/Commands/Write-GitHubLog.ps1 index 354f20a77..17fb025e1 100644 --- a/src/functions/public/Commands/Write-GitHubLog.ps1 +++ b/src/functions/public/Commands/Write-GitHubLog.ps1 @@ -9,17 +9,23 @@ When not running in GitHub Actions, uses standard Write-Host. .EXAMPLE + ```powershell Write-GitHubLog -Message 'Hello, World!' + ``` Writes 'Hello, World!' to the log. .EXAMPLE + ```powershell Write-GitHubLog -Message 'Error occurred!' -ForegroundColor Red + ``` Writes 'Error occurred!' in red text. .EXAMPLE + ```powershell Write-GitHubLog -Message 'Success!' -ForegroundColor Green -BackgroundColor Black + ``` Writes 'Success!' in green text on a black background. diff --git a/src/functions/public/Commands/Write-GitHubNotice.ps1 b/src/functions/public/Commands/Write-GitHubNotice.ps1 index 33c688917..1ee8ccd80 100644 --- a/src/functions/public/Commands/Write-GitHubNotice.ps1 +++ b/src/functions/public/Commands/Write-GitHubNotice.ps1 @@ -7,7 +7,9 @@ Write a notice message in GitHub Actions. The message will be displayed in the GitHub Actions log. .EXAMPLE + ```powershell Write-GitHubNotice -Message 'Hello, World!' + ``` Writes a notice message 'Hello, World!'. diff --git a/src/functions/public/Commands/Write-GitHubWarning.ps1 b/src/functions/public/Commands/Write-GitHubWarning.ps1 index 59b7de045..5439166dd 100644 --- a/src/functions/public/Commands/Write-GitHubWarning.ps1 +++ b/src/functions/public/Commands/Write-GitHubWarning.ps1 @@ -7,7 +7,9 @@ Write a warning message in GitHub Actions. The message will be displayed in the GitHub Actions log. .EXAMPLE + ```powershell Write-GitHubWarning -Message 'Hello, World!' + ``` Writes a warning message 'Hello, World!'. diff --git a/src/functions/public/Config/Get-GitHubConfig.ps1 b/src/functions/public/Config/Get-GitHubConfig.ps1 index 9471de437..aa7248b2e 100644 --- a/src/functions/public/Config/Get-GitHubConfig.ps1 +++ b/src/functions/public/Config/Get-GitHubConfig.ps1 @@ -7,7 +7,9 @@ Get a GitHub module configuration. .EXAMPLE + ```powershell Get-GitHubConfig -Name DefaultContext + ``` Get the DefaultContext value from the GitHub module configuration. diff --git a/src/functions/public/Config/Remove-GitHubConfig.ps1 b/src/functions/public/Config/Remove-GitHubConfig.ps1 index 8ae72d979..9e99c7718 100644 --- a/src/functions/public/Config/Remove-GitHubConfig.ps1 +++ b/src/functions/public/Config/Remove-GitHubConfig.ps1 @@ -7,7 +7,9 @@ Remove a GitHub module configuration. .EXAMPLE + ```powershell Remove-GitHubConfig -Name DefaultUser + ``` Removes the 'DefaultUser' item in the GitHub module configuration. diff --git a/src/functions/public/Config/Reset-GitHubConfig.ps1 b/src/functions/public/Config/Reset-GitHubConfig.ps1 index be3c7c951..4df18f8c9 100644 --- a/src/functions/public/Config/Reset-GitHubConfig.ps1 +++ b/src/functions/public/Config/Reset-GitHubConfig.ps1 @@ -7,7 +7,9 @@ Re-initializes the GitHub module configuration. .EXAMPLE + ```powershell Reset-GitHubConfig + ``` Re-initializes the GitHub module configuration. diff --git a/src/functions/public/Config/Set-GitHubConfig.ps1 b/src/functions/public/Config/Set-GitHubConfig.ps1 index 648ab97a7..d803f50ce 100644 --- a/src/functions/public/Config/Set-GitHubConfig.ps1 +++ b/src/functions/public/Config/Set-GitHubConfig.ps1 @@ -7,7 +7,9 @@ Set a GitHub module configuration. .EXAMPLE + ```powershell Set-GitHubConfig -Name DefaultUser -Value 'Octocat' + ``` Sets the value of DefaultUser to 'Octocat' in the GitHub module configuration. diff --git a/src/functions/public/Emojis/Get-GitHubEmoji.ps1 b/src/functions/public/Emojis/Get-GitHubEmoji.ps1 index ec00fba7e..58861edf2 100644 --- a/src/functions/public/Emojis/Get-GitHubEmoji.ps1 +++ b/src/functions/public/Emojis/Get-GitHubEmoji.ps1 @@ -8,12 +8,16 @@ If you pass the `Path` parameter, the emojis will be downloaded to the specified destination. .EXAMPLE + ```powershell Get-GitHubEmoji + ``` Gets all the emojis available to use on GitHub. .EXAMPLE + ```powershell Get-GitHubEmoji -Path 'C:\Users\user\Documents\GitHub\Emojis' + ``` Downloads all the emojis available to use on GitHub to the specified destination. diff --git a/src/functions/public/Enterprise/Get-GitHubEnterprise.ps1 b/src/functions/public/Enterprise/Get-GitHubEnterprise.ps1 index 20493743e..c36c6d144 100644 --- a/src/functions/public/Enterprise/Get-GitHubEnterprise.ps1 +++ b/src/functions/public/Enterprise/Get-GitHubEnterprise.ps1 @@ -9,7 +9,9 @@ specific enterprise name is provided, details about that single instance are returned. .EXAMPLE + ```powershell Get-GitHubEnterprise + ``` Output: ```powershell @@ -27,7 +29,9 @@ Retrieves details about all GitHub Enterprise instances for the user. .EXAMPLE + ```powershell Get-GitHubEnterprise -Name 'my-enterprise' + ``` Output: ```powershell diff --git a/src/functions/public/Enterprise/Get-GitHubEnterpriseOrganization.ps1 b/src/functions/public/Enterprise/Get-GitHubEnterpriseOrganization.ps1 index 8de156d2c..daf56baee 100644 --- a/src/functions/public/Enterprise/Get-GitHubEnterpriseOrganization.ps1 +++ b/src/functions/public/Enterprise/Get-GitHubEnterpriseOrganization.ps1 @@ -7,7 +7,9 @@ Use this function to retrieve the list of organizations in a GitHub Enterprise instance. .EXAMPLE + ```powershell Get-GitHubEnterpriseOrganization -Enterprise 'msx' + ``` .LINK https://psmodule.io/GitHub/Functions/Enterprise/Get-GitHubEnterpriseOrganization diff --git a/src/functions/public/Environments/Get-GitHubEnvironment.ps1 b/src/functions/public/Environments/Get-GitHubEnvironment.ps1 index 4c4979cfc..2e74f45e4 100644 --- a/src/functions/public/Environments/Get-GitHubEnvironment.ps1 +++ b/src/functions/public/Environments/Get-GitHubEnvironment.ps1 @@ -12,10 +12,12 @@ to use this function with a private repository. .EXAMPLE + ```powershell Get-GitHubEnvironment -Owner 'PSModule' -Repository 'EnvironmentTest' -Name 'test' + ``` Output: - ```pwsh + ```powershell id : 5944178128 node_id : EN_kwDOOJqfM88AAAABYkz10A name : test @@ -33,10 +35,12 @@ Retrieves details of the "test" environment in the specified repository. .EXAMPLE + ```powershell Get-GitHubEnvironment -Owner 'PSModule' -Repository 'EnvironmentTest' + ``` Output: - ```pwsh + ```powershell id : 5944178128 node_id : EN_kwDOOJqfM88AAAABYkz10A name : test diff --git a/src/functions/public/Environments/Remove-GitHubEnvironment.ps1 b/src/functions/public/Environments/Remove-GitHubEnvironment.ps1 index 393d988f1..36d533fcb 100644 --- a/src/functions/public/Environments/Remove-GitHubEnvironment.ps1 +++ b/src/functions/public/Environments/Remove-GitHubEnvironment.ps1 @@ -1,4 +1,4 @@ -filter Remove-GitHubEnvironment { +filter Remove-GitHubEnvironment { <# .SYNOPSIS Deletes an environment from a repository. @@ -8,7 +8,9 @@ filter Remove-GitHubEnvironment { The function supports ShouldProcess for confirmation before execution. .EXAMPLE + ```powershell Remove-GitHubEnvironment -Owner 'PSModule' -Repository 'GitHub' -Name 'Production' + ``` Deletes the 'Production' environment from the 'PSModule/GitHub' repository. diff --git a/src/functions/public/Environments/Set-GitHubEnvironment.ps1 b/src/functions/public/Environments/Set-GitHubEnvironment.ps1 index fe8992859..9c4097219 100644 --- a/src/functions/public/Environments/Set-GitHubEnvironment.ps1 +++ b/src/functions/public/Environments/Set-GitHubEnvironment.ps1 @@ -15,6 +15,7 @@ OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell $params = @{ Owner = "my-org" Repository = "my-repo" @@ -24,6 +25,7 @@ DeploymentBranchPolicy = 'CustomBranchPolicies' } Set-GitHubEnvironment @params + ``` Output: ```powershell diff --git a/src/functions/public/Git/Get-GitHubGitConfig.ps1 b/src/functions/public/Git/Get-GitHubGitConfig.ps1 index 06dc8834f..22fc3124f 100644 --- a/src/functions/public/Git/Get-GitHubGitConfig.ps1 +++ b/src/functions/public/Git/Get-GitHubGitConfig.ps1 @@ -7,7 +7,9 @@ Gets the global Git configuration. .EXAMPLE + ```powershell Get-GitHubGitConfig + ``` Gets the global Git configuration. diff --git a/src/functions/public/Git/Set-GitHubGitConfig.ps1 b/src/functions/public/Git/Set-GitHubGitConfig.ps1 index 60de58c7d..a9b1d3387 100644 --- a/src/functions/public/Git/Set-GitHubGitConfig.ps1 +++ b/src/functions/public/Git/Set-GitHubGitConfig.ps1 @@ -7,12 +7,16 @@ Sets the Git configuration for the GitHub context. This command sets the `user.name`, `user.email`, and `url..insteadOf` git configs. .EXAMPLE + ```powershell Set-GitHubGitConfig + ``` Sets the Git configuration for the default GitHub context. .EXAMPLE + ```powershell Set-GitHubGitConfig -Context 'MyContext' + ``` Sets the Git configuration for the GitHub context named 'MyContext'. diff --git a/src/functions/public/Gitignore/Get-GitHubGitignore.ps1 b/src/functions/public/Gitignore/Get-GitHubGitignore.ps1 index 4340a81ed..86d86a4af 100644 --- a/src/functions/public/Gitignore/Get-GitHubGitignore.ps1 +++ b/src/functions/public/Gitignore/Get-GitHubGitignore.ps1 @@ -8,12 +8,16 @@ If the Name parameter is specified, the function will return the gitignore template for the specified name. .EXAMPLE + ```powershell Get-GitHubGitignoreList + ``` Get all gitignore templates .EXAMPLE + ```powershell Get-GitHubGitignore -Name 'VisualStudio' + ``` Get a gitignore template for VisualStudio diff --git a/src/functions/public/Issues/ConvertFrom-IssueForm.ps1 b/src/functions/public/Issues/ConvertFrom-IssueForm.ps1 index cea4e1429..ba07446e5 100644 --- a/src/functions/public/Issues/ConvertFrom-IssueForm.ps1 +++ b/src/functions/public/Issues/ConvertFrom-IssueForm.ps1 @@ -8,10 +8,12 @@ Section titles become keys and their content becomes values. .EXAMPLE + ```powershell @' ### Section 1 Content 1 Content 2 + ``` ### Section 2 - [ ] Item 1 diff --git a/src/functions/public/License/Get-GitHubLicense.ps1 b/src/functions/public/License/Get-GitHubLicense.ps1 index d0fe9b632..3e21c4162 100644 --- a/src/functions/public/License/Get-GitHubLicense.ps1 +++ b/src/functions/public/License/Get-GitHubLicense.ps1 @@ -9,17 +9,23 @@ If the Owner and Repo parameters are specified, the function will return the license for the specified repository. .EXAMPLE + ```powershell Get-GitHubLicense + ``` Get all license templates .EXAMPLE + ```powershell Get-GitHubLicense -Name mit + ``` Get the mit license template .EXAMPLE + ```powershell Get-GitHubLicense -Owner 'octocat' -Repository 'Hello-World' + ``` Get the license for the Hello-World repository from the octocat account. diff --git a/src/functions/public/Markdown/Get-GitHubMarkdown.ps1 b/src/functions/public/Markdown/Get-GitHubMarkdown.ps1 index e04d5f538..5f31bfec9 100644 --- a/src/functions/public/Markdown/Get-GitHubMarkdown.ps1 +++ b/src/functions/public/Markdown/Get-GitHubMarkdown.ps1 @@ -7,8 +7,10 @@ Converts Markdown to HTML .EXAMPLE + ```powershell Get-GitHubMarkdown -Text "Hello **world**" "

Hello world

" + ``` Renders the Markdown text "Hello **world**" to HTML. diff --git a/src/functions/public/Markdown/Get-GitHubMarkdownRaw.ps1 b/src/functions/public/Markdown/Get-GitHubMarkdownRaw.ps1 index 212815387..bf681e0fa 100644 --- a/src/functions/public/Markdown/Get-GitHubMarkdownRaw.ps1 +++ b/src/functions/public/Markdown/Get-GitHubMarkdownRaw.ps1 @@ -9,8 +9,10 @@ format like a README.md file. Markdown content must be 400 KB or less. .EXAMPLE + ```powershell Get-GitHubMarkdownRaw -Text 'Hello, world!' "

Hello world

" + ``` Render the Markdown text 'Hello, world!' in raw mode. diff --git a/src/functions/public/Meta/Get-GitHubApiVersion.ps1 b/src/functions/public/Meta/Get-GitHubApiVersion.ps1 index cd9ac2b0a..e3ba1b0b9 100644 --- a/src/functions/public/Meta/Get-GitHubApiVersion.ps1 +++ b/src/functions/public/Meta/Get-GitHubApiVersion.ps1 @@ -7,7 +7,9 @@ Get all supported GitHub API versions. .EXAMPLE + ```powershell Get-GitHubApiVersion + ``` Get all supported GitHub API versions. diff --git a/src/functions/public/Meta/Get-GitHubMeta.ps1 b/src/functions/public/Meta/Get-GitHubMeta.ps1 index 156523d2f..d4d794715 100644 --- a/src/functions/public/Meta/Get-GitHubMeta.ps1 +++ b/src/functions/public/Meta/Get-GitHubMeta.ps1 @@ -15,7 +15,9 @@ documentation for each feature to determine if IPv6 is supported. .EXAMPLE + ```powershell Get-GitHubMeta + ``` Returns meta information about GitHub, including a list of GitHub's IP addresses. diff --git a/src/functions/public/Meta/Get-GitHubOctocat.ps1 b/src/functions/public/Meta/Get-GitHubOctocat.ps1 index ae2c8d438..f610cc598 100644 --- a/src/functions/public/Meta/Get-GitHubOctocat.ps1 +++ b/src/functions/public/Meta/Get-GitHubOctocat.ps1 @@ -7,12 +7,16 @@ Get the octocat as ASCII art. .EXAMPLE + ```powershell Get-GitHubOctocat + ``` Get the octocat as ASCII art .EXAMPLE + ```powershell Get-GitHubOctocat -S "Hello world" + ``` Get the octocat as ASCII art with a custom saying diff --git a/src/functions/public/Meta/Get-GitHubRoot.ps1 b/src/functions/public/Meta/Get-GitHubRoot.ps1 index 196782dcf..f278121fe 100644 --- a/src/functions/public/Meta/Get-GitHubRoot.ps1 +++ b/src/functions/public/Meta/Get-GitHubRoot.ps1 @@ -7,7 +7,9 @@ Get Hypermedia links to resources accessible in GitHub's REST API. .EXAMPLE + ```powershell Get-GitHubRoot + ``` Get the root endpoint for the GitHub API. diff --git a/src/functions/public/Meta/Get-GitHubZen.ps1 b/src/functions/public/Meta/Get-GitHubZen.ps1 index 7f2fbb7cc..53e19effd 100644 --- a/src/functions/public/Meta/Get-GitHubZen.ps1 +++ b/src/functions/public/Meta/Get-GitHubZen.ps1 @@ -7,7 +7,9 @@ Get a random sentence from the Zen of GitHub. .EXAMPLE + ```powershell Get-GitHubZen + ``` Get a random sentence from the Zen of GitHub. diff --git a/src/functions/public/Organization/Get-GitHubOrganization.ps1 b/src/functions/public/Organization/Get-GitHubOrganization.ps1 index 526e66e74..3c19b628a 100644 --- a/src/functions/public/Organization/Get-GitHubOrganization.ps1 +++ b/src/functions/public/Organization/Get-GitHubOrganization.ps1 @@ -10,27 +10,37 @@ Get an organization - if a organization name is provided. .EXAMPLE + ```powershell Get-GitHubOrganization + ``` List all organizations for the authenticated user. .EXAMPLE + ```powershell Get-GitHubOrganization -Username 'octocat' + ``` List public organizations for a specific user. .EXAMPLE + ```powershell Get-GitHubOrganization -All -Since 142951047 + ``` List all organizations made after an ID. .EXAMPLE + ```powershell Get-GitHubOrganization -Name 'PSModule' + ``` Get a specific organization. .EXAMPLE + ```powershell Get-GitHubOrganization -Enterprise 'msx' + ``` Get the organizations belonging to an Enterprise. diff --git a/src/functions/public/Organization/Members/Get-GitHubOrganizationPendingInvitation.ps1 b/src/functions/public/Organization/Members/Get-GitHubOrganizationPendingInvitation.ps1 index 3476a62c3..4c6bbb099 100644 --- a/src/functions/public/Organization/Members/Get-GitHubOrganizationPendingInvitation.ps1 +++ b/src/functions/public/Organization/Members/Get-GitHubOrganizationPendingInvitation.ps1 @@ -10,12 +10,16 @@ member, the `login` field in the return hash will be `null`. .EXAMPLE + ```powershell Get-GitHubOrganizationPendingInvitation -Organization 'github' + ``` List all pending organization invitations for the organization `github`. .EXAMPLE + ```powershell Get-GitHubOrganizationPendingInvitation -Organization 'github' -Role 'admin' + ``` List all pending organization invitations for the organization `github` with the role `admin`. diff --git a/src/functions/public/Organization/Members/New-GitHubOrganizationInvitation.ps1 b/src/functions/public/Organization/Members/New-GitHubOrganizationInvitation.ps1 index b1fb3633a..804a8ec17 100644 --- a/src/functions/public/Organization/Members/New-GitHubOrganizationInvitation.ps1 +++ b/src/functions/public/Organization/Members/New-GitHubOrganizationInvitation.ps1 @@ -13,12 +13,16 @@ and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)." .EXAMPLE + ```powershell New-GitHubOrganizationInvitation -Organization 'PSModule' -InviteeID 123456789 -Role 'admin' + ``` Invites the user with the ID `12345679` to the organization `PSModule` with the role `admin`. .EXAMPLE + ```powershell New-GitHubOrganizationInvitation -Organization 'PSModule' -Email 'user@psmodule.io' + ``` Invites the user with the email `user@psmodule.io` to the organization `PSModule`. diff --git a/src/functions/public/Organization/Members/Remove-GitHubOrganizationInvitation.ps1 b/src/functions/public/Organization/Members/Remove-GitHubOrganizationInvitation.ps1 index 2b3192f3c..8d9bf7781 100644 --- a/src/functions/public/Organization/Members/Remove-GitHubOrganizationInvitation.ps1 +++ b/src/functions/public/Organization/Members/Remove-GitHubOrganizationInvitation.ps1 @@ -9,7 +9,9 @@ This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). .EXAMPLE + ```powershell Remove-GitHubOrganizationInvitation -Organization 'github' -InvitationID '12345678' + ``` Cancel the invitation with the ID '12345678' for the organization `github`. diff --git a/src/functions/public/Organization/New-GitHubOrganization.ps1 b/src/functions/public/Organization/New-GitHubOrganization.ps1 index 7279e9358..6fbb3bb00 100644 --- a/src/functions/public/Organization/New-GitHubOrganization.ps1 +++ b/src/functions/public/Organization/New-GitHubOrganization.ps1 @@ -7,7 +7,9 @@ This function creates a new GitHub organization within the specified enterprise. .EXAMPLE + ```powershell New-GitHubOrganization -Enterprise 'my-enterprise' -Name 'my-org' -Owner 'user1' -BillingEmail 'billing@example.com' + ``` .OUTPUTS GitHubOrganization diff --git a/src/functions/public/Organization/Remove-GitHubOrganization.ps1 b/src/functions/public/Organization/Remove-GitHubOrganization.ps1 index 8f31b57c3..48ee1ef64 100644 --- a/src/functions/public/Organization/Remove-GitHubOrganization.ps1 +++ b/src/functions/public/Organization/Remove-GitHubOrganization.ps1 @@ -10,7 +10,9 @@ regarding account deletion before using this endpoint. .EXAMPLE + ```powershell Remove-GitHubOrganization -Name 'GitHub' + ``` Deletes the organization 'GitHub' and all its repositories. diff --git a/src/functions/public/Organization/Update-GitHubOrganization.ps1 b/src/functions/public/Organization/Update-GitHubOrganization.ps1 index 2315d6c90..3169dd79a 100644 --- a/src/functions/public/Organization/Update-GitHubOrganization.ps1 +++ b/src/functions/public/Organization/Update-GitHubOrganization.ps1 @@ -8,11 +8,14 @@ profile and member privileges. .EXAMPLE + ```powershell Update-GitHubOrganization -Organization 'GitHub' -Description 'The official GitHub organization.' + ``` Sets the description for the organization 'GitHub' to 'The official GitHub organization.'. .EXAMPLE + ```powershell $param = @{ Organization = 'GitHub' MembersCanCreatePublicRepositories = $true @@ -20,6 +23,7 @@ MembersCanCreateInternalRepositories = $true } Update-GitHubOrganization @param + ``` Sets the repository creation permissions for the organization 'GitHub' to allow all members to create public, private, and internal repositories. diff --git a/src/functions/public/Rate-Limit/Get-GitHubRateLimit.ps1 b/src/functions/public/Rate-Limit/Get-GitHubRateLimit.ps1 index c7a6830c0..31d1f1ff0 100644 --- a/src/functions/public/Rate-Limit/Get-GitHubRateLimit.ps1 +++ b/src/functions/public/Rate-Limit/Get-GitHubRateLimit.ps1 @@ -22,7 +22,9 @@ instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. .EXAMPLE + ```powershell Get-GitHubRateLimit + ``` Gets the rate limit status for the authenticated user. diff --git a/src/functions/public/Releases/Assets/Add-GitHubReleaseAsset.ps1 b/src/functions/public/Releases/Assets/Add-GitHubReleaseAsset.ps1 index 5e9832840..eaf3c7be7 100644 --- a/src/functions/public/Releases/Assets/Add-GitHubReleaseAsset.ps1 +++ b/src/functions/public/Releases/Assets/Add-GitHubReleaseAsset.ps1 @@ -37,12 +37,16 @@ the old file before you can re-upload the new asset. .EXAMPLE + ```powershell Add-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -ID '7654321' -Path 'C:\Users\octocat\Downloads\hello-world.zip' + ``` Gets the release assets for the release with the ID '1234567' for the repository 'octocat/hello-world'. .EXAMPLE + ```powershell Add-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -ID '7654321' -Path 'C:\Users\octocat\Projects\MyApp' + ``` Automatically creates a ZIP file from the contents of the MyApp directory and uploads it as a release asset. diff --git a/src/functions/public/Releases/Assets/Get-GitHubReleaseAsset.ps1 b/src/functions/public/Releases/Assets/Get-GitHubReleaseAsset.ps1 index 5042c6582..e0d2c5137 100644 --- a/src/functions/public/Releases/Assets/Get-GitHubReleaseAsset.ps1 +++ b/src/functions/public/Releases/Assets/Get-GitHubReleaseAsset.ps1 @@ -10,22 +10,30 @@ If a tag and name are provided, the specific named asset from the release with that tag is returned. .EXAMPLE + ```powershell Get-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -ID '1234567' + ``` Gets the release asset with the ID '1234567' for the repository 'octocat/hello-world'. .EXAMPLE + ```powershell Get-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -ReleaseID '7654321' + ``` Gets all release assets for the release with the ID '7654321' for the repository 'octocat/hello-world'. .EXAMPLE + ```powershell Get-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -ReleaseID '7654321' -Name 'example.zip' + ``` Gets the release asset named 'example.zip' from the release with ID '7654321' for the repository 'octocat/hello-world'. .EXAMPLE + ```powershell Get-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Name 'example.zip' + ``` Gets the release asset named 'example.zip' from the release tagged as 'v1.0.0' for the repository 'octocat/hello-world'. diff --git a/src/functions/public/Releases/Assets/Remove-GitHubReleaseAsset.ps1 b/src/functions/public/Releases/Assets/Remove-GitHubReleaseAsset.ps1 index 76efada9c..64d53944a 100644 --- a/src/functions/public/Releases/Assets/Remove-GitHubReleaseAsset.ps1 +++ b/src/functions/public/Releases/Assets/Remove-GitHubReleaseAsset.ps1 @@ -1,4 +1,4 @@ -filter Remove-GitHubReleaseAsset { +filter Remove-GitHubReleaseAsset { <# .SYNOPSIS Delete a release asset @@ -7,7 +7,9 @@ filter Remove-GitHubReleaseAsset { Delete a release asset .EXAMPLE + ```powershell Remove-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -ID '1234567' + ``` Deletes the release asset with the ID '1234567' for the repository 'octocat/hello-world'. diff --git a/src/functions/public/Releases/Assets/Save-GitHubReleaseAsset.ps1 b/src/functions/public/Releases/Assets/Save-GitHubReleaseAsset.ps1 index 575c8b7c3..8876b5aa5 100644 --- a/src/functions/public/Releases/Assets/Save-GitHubReleaseAsset.ps1 +++ b/src/functions/public/Releases/Assets/Save-GitHubReleaseAsset.ps1 @@ -9,7 +9,9 @@ personal access tokens (classic) or OAuth tokens with the `repo` scope are required. .EXAMPLE + ```powershell Save-GitHubReleaseAsset -Owner 'octocat' -Repository 'Hello-World' -ID '123456' -Path 'C:\Assets' + ``` Output: ```powershell @@ -23,7 +25,9 @@ Downloads release asset ID '123456' from the 'Hello-World' repository owned by 'octocat' to the specified path. .EXAMPLE + ```powershell Save-GitHubReleaseAsset -Owner 'octocat' -Repository 'Hello-World' -Tag 'v1.0.0' -Name 'binary.zip' -Path 'C:\Assets\app' -Expand -Force + ``` Output: ```powershell @@ -39,6 +43,7 @@ to the specified path, overwriting existing files during download and extraction. .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Repository = 'Hello-World' @@ -47,6 +52,7 @@ Name = 'binary.zip' } Get-GitHubReleaseAsset @params | Save-GitHubReleaseAsset -Path 'C:\Assets' -Expand -Force + ``` Pipes a release asset object directly to the Save-GitHubReleaseAsset function, which downloads and extracts it. diff --git a/src/functions/public/Releases/Assets/Update-GitHubReleaseAsset.ps1 b/src/functions/public/Releases/Assets/Update-GitHubReleaseAsset.ps1 index ac95ac0d5..a5f6d519b 100644 --- a/src/functions/public/Releases/Assets/Update-GitHubReleaseAsset.ps1 +++ b/src/functions/public/Releases/Assets/Update-GitHubReleaseAsset.ps1 @@ -7,7 +7,9 @@ Users with push access to the repository can edit a release asset. .EXAMPLE + ```powershell Update-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -ID '1234567' -Name 'new_asset_name' -Label 'new_asset_label' + ``` Updates the release asset with the ID '1234567' for the repository 'octocat/hello-world' with the new name 'new_asset_name' and label 'new_asset_label'. diff --git a/src/functions/public/Releases/Get-GitHubRelease.ps1 b/src/functions/public/Releases/Get-GitHubRelease.ps1 index e4bd3081c..36cb1e0fa 100644 --- a/src/functions/public/Releases/Get-GitHubRelease.ps1 +++ b/src/functions/public/Releases/Get-GitHubRelease.ps1 @@ -9,22 +9,30 @@ Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. .EXAMPLE + ```powershell Get-GitHubRelease -Owner 'octocat' -Repository 'hello-world' + ``` Gets the latest release for the repository 'hello-world' owned by 'octocat'. .EXAMPLE + ```powershell Get-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -AllVersions + ``` Gets all releases for the repository 'hello-world' owned by 'octocat'. .EXAMPLE + ```powershell Get-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' + ``` Gets the release with the tag 'v1.0.0' for the repository 'hello-world' owned by 'octocat'. .EXAMPLE + ```powershell Get-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -ID '1234567' + ``` Gets the release with the ID '1234567' for the repository 'hello-world' owned by 'octocat'. diff --git a/src/functions/public/Releases/New-GitHubRelease.ps1 b/src/functions/public/Releases/New-GitHubRelease.ps1 index 67aa10cf7..275b3abe9 100644 --- a/src/functions/public/Releases/New-GitHubRelease.ps1 +++ b/src/functions/public/Releases/New-GitHubRelease.ps1 @@ -11,28 +11,38 @@ and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. .EXAMPLE + ```powershell New-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Target 'main' -Notes 'Release notes' + ``` Creates a release for the repository 'octocat/hello-world' on the 'main' branch with the tag 'v1.0.0'. .EXAMPLE + ```powershell New-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v0.9.0' -Name 'Beta Release' -Draft -Prerelease + ``` Creates a draft prerelease for the repository 'octocat/hello-world' with the tag 'v0.9.0' using the default target branch ('main'). .EXAMPLE + ```powershell New-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v2.0.0' -Latest + ``` Creates a release for the repository 'octocat/hello-world' with the tag 'v2.0.0' and marks it as the latest release. Note that when using -Latest, you cannot use -Draft or -Prerelease as they are mutually exclusive. .EXAMPLE + ```powershell New-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.1.0' -GenerateReleaseNotes + ``` Creates a release for the repository 'octocat/hello-world' with the tag 'v1.1.0' and automatically generates release notes based on commits since the previous release. .EXAMPLE + ```powershell New-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.2.0' -DiscussionCategoryName 'Announcements' -Notes 'Major update with new features' + ``` Creates a release for the repository 'octocat/hello-world' with the tag 'v1.2.0' and creates a discussion in the 'Announcements' category linked to this release. diff --git a/src/functions/public/Releases/New-GitHubReleaseNote.ps1 b/src/functions/public/Releases/New-GitHubReleaseNote.ps1 index a81e18130..fe07d0233 100644 --- a/src/functions/public/Releases/New-GitHubReleaseNote.ps1 +++ b/src/functions/public/Releases/New-GitHubReleaseNote.ps1 @@ -9,18 +9,21 @@ The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release. .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Repository = 'hello-world' Tag = 'v1.0.0' } New-GitHubReleaseNote @params + ``` Creates a new release notes draft for the repository 'hello-world' owned by 'octocat' with the tag name 'v1.0.0'. In this example the tag 'v1.0.0' has to exist in the repository. The configuration file '.github/release.yml' or '.github/release.yaml' will be used. .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Repository = 'hello-world' @@ -28,11 +31,13 @@ Target = 'main' } New-GitHubReleaseNote @params + ``` Creates a new release notes draft for the repository 'hello-world' owned by 'octocat' with the tag name 'v1.0.0'. In this example the tag 'v1.0.0' has to exist in the repository. .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Repository = 'hello-world' @@ -42,6 +47,7 @@ ConfigurationFilePath = '.github/custom_release_config.yml' } New-GitHubReleaseNote @params + ``` Creates a new release notes draft for the repository 'hello-world' owned by 'octocat' with the tag name 'v1.0.0'. The release notes will be based on the changes between the tags 'v0.9.2' and 'v1.0.0' and generated based on the diff --git a/src/functions/public/Releases/Remove-GitHubRelease.ps1 b/src/functions/public/Releases/Remove-GitHubRelease.ps1 index 6bddf1cb0..1ad90ecfd 100644 --- a/src/functions/public/Releases/Remove-GitHubRelease.ps1 +++ b/src/functions/public/Releases/Remove-GitHubRelease.ps1 @@ -1,4 +1,4 @@ -filter Remove-GitHubRelease { +filter Remove-GitHubRelease { <# .SYNOPSIS Delete a release @@ -7,7 +7,9 @@ filter Remove-GitHubRelease { Users with push access to the repository can delete a release. .EXAMPLE + ```powershell Remove-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -ID '1234567' + ``` Deletes the release with the ID '1234567' for the repository 'octocat/hello-world'. diff --git a/src/functions/public/Releases/Set-GitHubRelease.ps1 b/src/functions/public/Releases/Set-GitHubRelease.ps1 index 41f0e483e..f11f55055 100644 --- a/src/functions/public/Releases/Set-GitHubRelease.ps1 +++ b/src/functions/public/Releases/Set-GitHubRelease.ps1 @@ -16,38 +16,52 @@ When using the 'Latest' parameter, the release will be promoted from draft/prerelease status to a full release. .EXAMPLE + ```powershell Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Target 'main' -Notes 'Release notes' + ``` Creates a new release with tag 'v1.0.0' targeting the 'main' branch. .EXAMPLE + ```powershell Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Notes 'Updated release notes' + ``` Updates an existing release with tag 'v1.0.0' to have new release notes. .EXAMPLE + ```powershell Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Draft + ``` Creates or updates a release as a draft release. .EXAMPLE + ```powershell Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Prerelease + ``` Creates or updates a release as a prerelease. .EXAMPLE + ```powershell Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Latest + ``` Sets the release with tag 'v1.0.0' as the latest release for the repository. If the release was a draft or prerelease, it will be promoted to a full release. .EXAMPLE + ```powershell Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -GenerateReleaseNotes + ``` Creates or updates a release with automatically generated release notes based on pull requests and commits. .EXAMPLE + ```powershell Get-GitHubRepository -Owner 'octocat' -Repository 'hello-world' | Set-GitHubRelease -Tag 'v1.0.0' -Notes 'Release notes' + ``` Creates or updates a release using pipeline input for the repository. diff --git a/src/functions/public/Releases/Update-GitHubRelease.ps1 b/src/functions/public/Releases/Update-GitHubRelease.ps1 index 92d27100c..4671e3519 100644 --- a/src/functions/public/Releases/Update-GitHubRelease.ps1 +++ b/src/functions/public/Releases/Update-GitHubRelease.ps1 @@ -10,23 +10,31 @@ The function also accepts GitHubRelease objects through the pipeline. .EXAMPLE + ```powershell Update-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -ID '1234567' -Notes 'Release notes' + ``` Updates the release with the ID '1234567' for the repository 'octocat/hello-world' with the note 'Release notes'. .EXAMPLE + ```powershell Update-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0' -Name 'Release v1.0' -Notes 'Stable release' + ``` Updates the release with the tag 'v1.0' for the repository 'octocat/hello-world' with a new name and notes. .EXAMPLE + ```powershell Get-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0' | Update-GitHubRelease -Draft:$false -Prerelease + ``` Gets a release by tag and updates it to be a prerelease (not a draft). .EXAMPLE + ```powershell Update-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0' -Latest -GenerateReleaseNotes + ``` Updates the release with tag 'v1.0' to be the latest release and automatically generates release notes. diff --git a/src/functions/public/Repositories/Autolinks/Get-GitHubRepositoryAutolink.ps1 b/src/functions/public/Repositories/Autolinks/Get-GitHubRepositoryAutolink.ps1 index 21aaed536..3f4d7b96c 100644 --- a/src/functions/public/Repositories/Autolinks/Get-GitHubRepositoryAutolink.ps1 +++ b/src/functions/public/Repositories/Autolinks/Get-GitHubRepositoryAutolink.ps1 @@ -9,12 +9,16 @@ Information about autolinks are only available to repository administrators. .EXAMPLE + ```powershell Get-GitHubRepositoryAutolink -Owner 'octocat' -Repository 'Hello-World' + ``` Gets all autolinks for the repository 'Hello-World' owned by 'octocat'. .EXAMPLE + ```powershell Get-GitHubRepositoryAutolink -Owner 'octocat' -Repository 'Hello-World' -ID 1 + ``` Gets the autolink with the ID 1 for the repository 'Hello-World' owned by 'octocat'. diff --git a/src/functions/public/Repositories/Autolinks/New-GitHubRepositoryAutolink.ps1 b/src/functions/public/Repositories/Autolinks/New-GitHubRepositoryAutolink.ps1 index bdfc0ce06..f4e72a598 100644 --- a/src/functions/public/Repositories/Autolinks/New-GitHubRepositoryAutolink.ps1 +++ b/src/functions/public/Repositories/Autolinks/New-GitHubRepositoryAutolink.ps1 @@ -7,7 +7,9 @@ Users with admin access to the repository can create an autolink. .EXAMPLE + ```powershell New-GitHubRepositoryAutolink -Owner 'octocat' -Repository 'Hello-World' -KeyPrefix 'GH-' -UrlTemplate 'https://www.example.com/issue/' + ``` Creates an autolink for the repository 'Hello-World' owned by 'octocat' that links to when the prefix 'GH-' is found in an issue, pull request, or commit. diff --git a/src/functions/public/Repositories/Autolinks/Remove-GitHubRepositoryAutolink.ps1 b/src/functions/public/Repositories/Autolinks/Remove-GitHubRepositoryAutolink.ps1 index 1e1b9b2cb..ced19d6fa 100644 --- a/src/functions/public/Repositories/Autolinks/Remove-GitHubRepositoryAutolink.ps1 +++ b/src/functions/public/Repositories/Autolinks/Remove-GitHubRepositoryAutolink.ps1 @@ -9,7 +9,9 @@ Information about autolinks are only available to repository administrators. .EXAMPLE + ```powershell Remove-GitHubRepositoryAutolink -Owner 'octocat' -Repository 'Hello-World' -AutolinkId 1 + ``` Deletes the autolink with ID 1 for the repository 'Hello-World' owned by 'octocat'. diff --git a/src/functions/public/Repositories/CustomProperties/Get-GitHubRepositoryCustomProperty.ps1 b/src/functions/public/Repositories/CustomProperties/Get-GitHubRepositoryCustomProperty.ps1 index f82e932f7..8bb6371a2 100644 --- a/src/functions/public/Repositories/CustomProperties/Get-GitHubRepositoryCustomProperty.ps1 +++ b/src/functions/public/Repositories/CustomProperties/Get-GitHubRepositoryCustomProperty.ps1 @@ -8,7 +8,9 @@ Users with read access to the repository can use this endpoint. .EXAMPLE + ```powershell Get-GitHubRepositoryCustomProperty -Owner 'octocat' -Repository 'hello-world' + ``` Gets all custom property values that are set for the 'hello-world' repository. diff --git a/src/functions/public/Repositories/Get-GitHubRepository.ps1 b/src/functions/public/Repositories/Get-GitHubRepository.ps1 index ea1d37fed..b37278a77 100644 --- a/src/functions/public/Repositories/Get-GitHubRepository.ps1 +++ b/src/functions/public/Repositories/Get-GitHubRepository.ps1 @@ -11,27 +11,37 @@ Can also be used with the name parameter to get a specific repository. .EXAMPLE + ```powershell Get-GitHubRepository + ``` Gets the repositories for the authenticated user. .EXAMPLE + ```powershell Get-GitHubRepository -Username 'octocat' + ``` Gets the repositories for the specified user. .EXAMPLE + ```powershell Get-GitHubRepository -Organization 'github' -Name 'octocat' + ``` Gets the specified repository. .EXAMPLE + ```powershell Get-GitHubRepository -Organization 'github' -Team 'my-team' + ``` Gets repositories that the 'my-team' team has access to in the `github` organization. .EXAMPLE + ```powershell Get-GitHubRepository -Organization 'github' -Name 'octocat' -Team 'my-team' + ``` Gets the repository and permission for the `my-team` team on the `octocat` repository in the `github` organization. diff --git a/src/functions/public/Repositories/Move-GitHubRepository.ps1 b/src/functions/public/Repositories/Move-GitHubRepository.ps1 index 204d24318..69f5f0951 100644 --- a/src/functions/public/Repositories/Move-GitHubRepository.ps1 +++ b/src/functions/public/Repositories/Move-GitHubRepository.ps1 @@ -12,7 +12,9 @@ a fine-grained personal access token cannot be used because they are only granted access to a single account. .EXAMPLE + ```powershell Move-GitHubRepository -Owner 'PSModule' -Name 'GitHub' -NewOwner 'GitHub' -NewName 'PowerShell' + ``` Moves the GitHub repository to the PSModule organization and renames it to GitHub. diff --git a/src/functions/public/Repositories/New-GitHubRepository.ps1 b/src/functions/public/Repositories/New-GitHubRepository.ps1 index cc0a0d7dd..38ab5f58c 100644 --- a/src/functions/public/Repositories/New-GitHubRepository.ps1 +++ b/src/functions/public/Repositories/New-GitHubRepository.ps1 @@ -14,6 +14,7 @@ * `repo` scope to create a private repository .EXAMPLE + ```powershell $params = @{ Name = 'Hello-World' Description = 'This is your first repository' @@ -31,10 +32,12 @@ SquashMergeCommitMessage = 'PR_BODY' } New-GitHubRepository @params + ``` Creates a new public repository named "Hello-World" owned by the authenticated user. .EXAMPLE + ```powershell $params = @{ Organization = 'PSModule' Name = 'Hello-World' @@ -52,10 +55,12 @@ SquashMergeCommitMessage = 'PR_BODY' } New-GitHubRepository @params + ``` Creates a new public repository named "Hello-World" owned by the organization "PSModule". .EXAMPLE + ```powershell $params = @{ TemplateOwner = 'GitHub' TemplateRepository = 'octocat' @@ -66,10 +71,12 @@ Visibility = 'Private' } New-GitHubRepository @params + ``` Creates a new private repository named `MyNewRepo` from the `octocat` template repository owned by `GitHub`. .EXAMPLE + ```powershell $params = @{ ForkOwner = 'octocat' ForkRepo = 'Hello-World' @@ -78,6 +85,7 @@ DefaultBranchOnly = $true } New-GitHubRepository @params + ``` Creates a new repository named `MyNewRepo` as a fork of `Hello-World` owned by `octocat`. Only the default branch will be forked. diff --git a/src/functions/public/Repositories/Permissions/Get-GitHubRepositoryPermission.ps1 b/src/functions/public/Repositories/Permissions/Get-GitHubRepositoryPermission.ps1 index e8fee6918..62812be83 100644 --- a/src/functions/public/Repositories/Permissions/Get-GitHubRepositoryPermission.ps1 +++ b/src/functions/public/Repositories/Permissions/Get-GitHubRepositoryPermission.ps1 @@ -7,7 +7,9 @@ Retrieves the permission level assigned to a specific team for a given GitHub repository. .EXAMPLE + ```powershell Get-GitHubRepositoryPermission -Owner 'octocat' -Name 'Hello-World' -Team 'core' + ``` Output: ```powershell @@ -16,9 +18,6 @@ Retrieves the permission of the 'core' team on the 'Hello-World' repository owned by 'octocat'. - .EXAMPLE - - .INPUTS GitHubRepository diff --git a/src/functions/public/Repositories/Permissions/Remove-GitHubRepositoryPermission.ps1 b/src/functions/public/Repositories/Permissions/Remove-GitHubRepositoryPermission.ps1 index ba25d66e8..b5af706fd 100644 --- a/src/functions/public/Repositories/Permissions/Remove-GitHubRepositoryPermission.ps1 +++ b/src/functions/public/Repositories/Permissions/Remove-GitHubRepositoryPermission.ps1 @@ -7,7 +7,9 @@ This function removes a team's access to a specific repository within an organization. .EXAMPLE + ```powershell Remove-GitHubRepositoryPermission -Owner 'my-org' -Name 'repo-name' -Team 'dev-team' + ``` Removes the 'dev-team' permissions from the 'repo-name' repository under 'my-org'. diff --git a/src/functions/public/Repositories/Permissions/Set-GitHubRepositoryPermission.ps1 b/src/functions/public/Repositories/Permissions/Set-GitHubRepositoryPermission.ps1 index a2ab0cbe6..d03437497 100644 --- a/src/functions/public/Repositories/Permissions/Set-GitHubRepositoryPermission.ps1 +++ b/src/functions/public/Repositories/Permissions/Set-GitHubRepositoryPermission.ps1 @@ -9,7 +9,9 @@ 'None' is specified, the function removes the team's access to the repository. .EXAMPLE + ```powershell Set-GitHubRepositoryPermission -Owner 'MyOrg' -Name 'MyRepo' -Team 'devs' -Permission 'push' + ``` Grants the 'push' permission to the 'devs' team for the repository 'MyRepo' owned by 'MyOrg'. diff --git a/src/functions/public/Repositories/Remove-GitHubRepository.ps1 b/src/functions/public/Repositories/Remove-GitHubRepository.ps1 index c96546fb3..d70111d92 100644 --- a/src/functions/public/Repositories/Remove-GitHubRepository.ps1 +++ b/src/functions/public/Repositories/Remove-GitHubRepository.ps1 @@ -10,7 +10,9 @@ repositories, you will get a `403 Forbidden` response. .EXAMPLE + ```powershell Remove-GitHubRepository -Owner 'PSModule' -Name 'Hello-World' + ``` Deletes the repository `Hello-World` in the `PSModule` organization. diff --git a/src/functions/public/Repositories/Repositories/Disable-GitHubRepositoryPrivateVulnerabilityReporting.ps1 b/src/functions/public/Repositories/Repositories/Disable-GitHubRepositoryPrivateVulnerabilityReporting.ps1 index fcaccf936..9240228a0 100644 --- a/src/functions/public/Repositories/Repositories/Disable-GitHubRepositoryPrivateVulnerabilityReporting.ps1 +++ b/src/functions/public/Repositories/Repositories/Disable-GitHubRepositoryPrivateVulnerabilityReporting.ps1 @@ -9,7 +9,9 @@ "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)". .EXAMPLE + ```powershell Disable-GitHubRepositoryPrivateVulnerabilityReporting -Owner 'PSModule' -Name 'GitHub' + ``` Disables private vulnerability reporting for the PSModule/GitHub repository. diff --git a/src/functions/public/Repositories/Repositories/Disable-GitHubRepositorySecurityFix.ps1 b/src/functions/public/Repositories/Repositories/Disable-GitHubRepositorySecurityFix.ps1 index 452365d86..b8df36bcf 100644 --- a/src/functions/public/Repositories/Repositories/Disable-GitHubRepositorySecurityFix.ps1 +++ b/src/functions/public/Repositories/Repositories/Disable-GitHubRepositorySecurityFix.ps1 @@ -9,7 +9,9 @@ "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". .EXAMPLE + ```powershell Disable-GitHubRepositorySecurityFix -Owner 'PSModule' -Name 'GitHub' + ``` Disables automated security fixes for the repository. diff --git a/src/functions/public/Repositories/Repositories/Disable-GitHubRepositoryVulnerabilityAlert.ps1 b/src/functions/public/Repositories/Repositories/Disable-GitHubRepositoryVulnerabilityAlert.ps1 index 3b43161d5..0d1cc5a39 100644 --- a/src/functions/public/Repositories/Repositories/Disable-GitHubRepositoryVulnerabilityAlert.ps1 +++ b/src/functions/public/Repositories/Repositories/Disable-GitHubRepositoryVulnerabilityAlert.ps1 @@ -9,7 +9,9 @@ "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". .EXAMPLE + ```powershell Disable-GitHubRepositoryVulnerabilityAlert -Owner 'octocat' -Name 'hello-world' + ``` Disables vulnerability alerts for the 'octocat/hello-world' repository. diff --git a/src/functions/public/Repositories/Repositories/Enable-GitHubRepositoryPrivateVulnerabilityReporting.ps1 b/src/functions/public/Repositories/Repositories/Enable-GitHubRepositoryPrivateVulnerabilityReporting.ps1 index d6bebba62..6f59ebceb 100644 --- a/src/functions/public/Repositories/Repositories/Enable-GitHubRepositoryPrivateVulnerabilityReporting.ps1 +++ b/src/functions/public/Repositories/Repositories/Enable-GitHubRepositoryPrivateVulnerabilityReporting.ps1 @@ -9,7 +9,9 @@ "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)." .EXAMPLE + ```powershell Enable-GitHubRepositoryPrivateVulnerabilityReporting -Owner 'PSModule' -Name 'GitHub' + ``` Enables private vulnerability reporting for the PSModule/GitHub repository. diff --git a/src/functions/public/Repositories/Repositories/Enable-GitHubRepositorySecurityFix.ps1 b/src/functions/public/Repositories/Repositories/Enable-GitHubRepositorySecurityFix.ps1 index 67fa2f94f..8b84b61fd 100644 --- a/src/functions/public/Repositories/Repositories/Enable-GitHubRepositorySecurityFix.ps1 +++ b/src/functions/public/Repositories/Repositories/Enable-GitHubRepositorySecurityFix.ps1 @@ -9,7 +9,9 @@ "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". .EXAMPLE + ```powershell Enable-GitHubRepositorySecurityFix -Owner 'PSModule' -Name 'GitHub' + ``` Enables automated security fixes for the repository. diff --git a/src/functions/public/Repositories/Repositories/Enable-GitHubRepositoryVulnerabilityAlert.ps1 b/src/functions/public/Repositories/Repositories/Enable-GitHubRepositoryVulnerabilityAlert.ps1 index 584ed3668..7802a2f8e 100644 --- a/src/functions/public/Repositories/Repositories/Enable-GitHubRepositoryVulnerabilityAlert.ps1 +++ b/src/functions/public/Repositories/Repositories/Enable-GitHubRepositoryVulnerabilityAlert.ps1 @@ -10,7 +10,9 @@ "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". .EXAMPLE + ```powershell Enable-GitHubRepositoryVulnerabilityAlert -Owner 'octocat' -Name 'hello-world' + ``` Enables vulnerability alerts for the 'octocat/hello-world' repository. diff --git a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryActivity.ps1 b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryActivity.ps1 index e73fcf83d..dd43ec0b7 100644 --- a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryActivity.ps1 +++ b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryActivity.ps1 @@ -11,27 +11,42 @@ see "[Viewing activity and data for your repository](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository)." .EXAMPLE + ```powershell Get-GitHubRepositoryActivity -Owner 'PSModule' -Name 'GitHub' + ``` .EXAMPLE + ```powershell Get-GitHubRepositoryActivity -Owner 'PSModule' -Name 'GitHub' -Direction 'asc' + ``` .EXAMPLE + ```powershell Get-GitHubRepositoryActivity -Owner 'PSModule' -Name 'GitHub' -PerPage 100 + ``` .EXAMPLE + ```powershell Get-GitHubRepositoryActivity -Owner 'PSModule' -Name 'GitHub' -Before '2021-01-01T00:00:00Z' + ``` .EXAMPLE + ```powershell Get-GitHubRepositoryActivity -Owner 'PSModule' -Name 'GitHub' -After '2021-01-01T00:00:00Z' + ``` .EXAMPLE + ```powershell Get-GitHubRepositoryActivity -Owner 'PSModule' -Name 'GitHub' -Ref 'refs/heads/main' + ``` .EXAMPLE + ```powershell Get-GitHubRepositoryActivity -Owner 'PSModule' -Name 'GitHub' -Actor 'octocat' + ``` .EXAMPLE + ```powershell $params = @{ Owner = 'PSModule' Repo = 'GitHub' @@ -39,11 +54,14 @@ } Get-GitHubRepositoryActivity @params | Select-Object -Property @{n='actor';e={$_.actor.login}},activity_type,ref,timestamp + ``` Gets the activity for the past 24 hours and selects the actor, activity type, ref, and timestamp. .EXAMPLE + ```powershell Get-GitHubRepositoryActivity -Owner 'PSModule' -Name 'GitHub' -ActivityType 'push','force_push' + ``` .NOTES [List repository activities](https://docs.github.com/rest/repos/repos#list-repository-activities) diff --git a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryCodeownersError.ps1 b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryCodeownersError.ps1 index 20d8ae32f..efec4e854 100644 --- a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryCodeownersError.ps1 +++ b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryCodeownersError.ps1 @@ -10,7 +10,9 @@ see "[About code owners](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)." .EXAMPLE + ```powershell Get-GitHubRepositoryCodeownersError -Owner 'PSModule' -Name 'GitHub' + ``` Gets the CODEOWNERS errors for the repository. diff --git a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryContributor.ps1 b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryContributor.ps1 index fe85303fd..46d7fb7c6 100644 --- a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryContributor.ps1 +++ b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryContributor.ps1 @@ -12,7 +12,9 @@ in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. .EXAMPLE + ```powershell Get-GitHubRepositoryContributor -Owner 'PSModule' -Name 'GitHub' + ``` Gets all contributors to the GitHub repository. diff --git a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryFork.ps1 b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryFork.ps1 index d9d6ab9f9..fcca625f4 100644 --- a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryFork.ps1 +++ b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryFork.ps1 @@ -7,7 +7,9 @@ List forks of a named repository. .EXAMPLE + ```powershell Get-GitHubRepositoryFork -Owner 'octocat' -Name 'Hello-World' + ``` List forks of the 'Hello-World' repository owned by 'octocat'. diff --git a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryLanguage.ps1 b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryLanguage.ps1 index 19c67c1e0..b5c84d25e 100644 --- a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryLanguage.ps1 +++ b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryLanguage.ps1 @@ -8,7 +8,9 @@ bytes of code written in that language. .EXAMPLE + ```powershell Get-GitHubRepositoryLanguage -Owner 'octocat' -Name 'hello-world' + ``` Gets the languages for the 'hello-world' repository owned by 'octocat'. diff --git a/src/functions/public/Repositories/Repositories/Get-GitHubRepositorySecurityFix.ps1 b/src/functions/public/Repositories/Repositories/Get-GitHubRepositorySecurityFix.ps1 index c1c190893..7c08886a1 100644 --- a/src/functions/public/Repositories/Repositories/Get-GitHubRepositorySecurityFix.ps1 +++ b/src/functions/public/Repositories/Repositories/Get-GitHubRepositorySecurityFix.ps1 @@ -9,7 +9,9 @@ "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". .EXAMPLE + ```powershell Get-GitHubRepositorySecurityFix -Owner 'PSModule' -Name 'GitHub' + ``` Gets the automated security fixes status for the GitHub repository. diff --git a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTag.ps1 b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTag.ps1 index c0b990b43..6ee76facb 100644 --- a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTag.ps1 +++ b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTag.ps1 @@ -7,7 +7,9 @@ List repository tags .EXAMPLE + ```powershell Get-GitHubRepositoryTag -Owner 'PSModule' -Name 'GitHub' + ``` Gets all tags of the GitHub repository. diff --git a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTeam.ps1 b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTeam.ps1 index f448e6163..220481bd6 100644 --- a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTeam.ps1 +++ b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTeam.ps1 @@ -15,7 +15,9 @@ This endpoint is not compatible with fine-grained personal access tokens. .EXAMPLE + ```powershell Get-GitHubRepositoryTeam -Owner 'PSModule' -Name 'GitHub' + ``` Lists the teams that have access to the specified repository and that are also visible to the authenticated user. diff --git a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTopic.ps1 b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTopic.ps1 index b2a9aeabb..a9e2f3522 100644 --- a/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTopic.ps1 +++ b/src/functions/public/Repositories/Repositories/Get-GitHubRepositoryTopic.ps1 @@ -7,6 +7,18 @@ Get all repository topics .EXAMPLE + ```powershell + Get-GitHubRepositoryTopic -Owner 'octocat' -Name 'Hello-World' + ``` + + Output: + ```powershell + topic1 + topic2 + topic3 + ``` + + Retrieves all topics for the 'Hello-World' repository owned by 'octocat'. .NOTES [Get all repository topics](https://docs.github.com/rest/repos/repos#get-all-repository-topics) diff --git a/src/functions/public/Repositories/Repositories/Set-GitHubRepositoryTopic.ps1 b/src/functions/public/Repositories/Repositories/Set-GitHubRepositoryTopic.ps1 index 93ca0c5b1..f06061d0a 100644 --- a/src/functions/public/Repositories/Repositories/Set-GitHubRepositoryTopic.ps1 +++ b/src/functions/public/Repositories/Repositories/Set-GitHubRepositoryTopic.ps1 @@ -7,7 +7,9 @@ Replace all repository topics .EXAMPLE + ```powershell Set-GitHubRepositoryTopic -Owner 'octocat' -Name 'hello-world' -Topic 'octocat', 'octo', 'octocat/hello-world' + ``` Replaces all topics for the repository 'octocat/hello-world' with the topics 'octocat', 'octo', 'octocat/hello-world'. diff --git a/src/functions/public/Repositories/Repositories/Start-GitHubRepositoryEvent.ps1 b/src/functions/public/Repositories/Repositories/Start-GitHubRepositoryEvent.ps1 index eb4fef843..ab6fecced 100644 --- a/src/functions/public/Repositories/Repositories/Start-GitHubRepositoryEvent.ps1 +++ b/src/functions/public/Repositories/Repositories/Start-GitHubRepositoryEvent.ps1 @@ -25,6 +25,7 @@ This input example shows how you can use the `client_payload` as a test to debug your workflow. .EXAMPLE + ```powershell $params = @{ EventType = 'on-demand-test' ClientPayload = @{ @@ -33,6 +34,7 @@ } } Start-GitHubRepositoryEvent @params + ``` Starts a repository event with the name `on-demand-test` and a `client_payload` that includes `unit` and `integration`. diff --git a/src/functions/public/Repositories/Repositories/Test-GitHubRepositoryVulnerabilityAlert.ps1 b/src/functions/public/Repositories/Repositories/Test-GitHubRepositoryVulnerabilityAlert.ps1 index c4bf7ebaf..c23fe55ed 100644 --- a/src/functions/public/Repositories/Repositories/Test-GitHubRepositoryVulnerabilityAlert.ps1 +++ b/src/functions/public/Repositories/Repositories/Test-GitHubRepositoryVulnerabilityAlert.ps1 @@ -10,7 +10,9 @@ "[About security alerts for vulnerable dependencies](https://docs.github.com/articles/about-security-alerts-for-vulnerable-dependencies)". .EXAMPLE + ```powershell Test-GitHubRepositoryVulnerabilityAlert -Owner 'PSModule' -Name 'GitHub' + ``` Checks if vulnerability alerts are enabled for the PSModule/GitHub repository. diff --git a/src/functions/public/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuite.ps1 b/src/functions/public/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuite.ps1 index 741f9e9b3..b96dcee57 100644 --- a/src/functions/public/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuite.ps1 +++ b/src/functions/public/Repositories/RuleSuite/Get-GitHubRepositoryRuleSuite.ps1 @@ -9,6 +9,7 @@ For more information, see"[Managing rulesets for a repository](https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Repo = 'hello-world' @@ -18,11 +19,14 @@ RuleSuiteResult = 'all' } Get-GitHubRepositoryRuleSuite @params + ``` Gets a list of rule suites for the main branch of the hello-world repository owned by octocat. .EXAMPLE + ```powershell Get-GitHubRepositoryRuleSuite -Owner 'octocat' -Repository 'hello-world' -RuleSuiteId 123456789 + ``` Gets information about a suite of rule evaluations with ID 123456789 from within the octocat/hello-world repository. diff --git a/src/functions/public/Repositories/Set-GitHubRepository.ps1 b/src/functions/public/Repositories/Set-GitHubRepository.ps1 index 2035521dc..96e30b43e 100644 --- a/src/functions/public/Repositories/Set-GitHubRepository.ps1 +++ b/src/functions/public/Repositories/Set-GitHubRepository.ps1 @@ -9,12 +9,15 @@ provided parameters. The updated or newly created repository is returned. .EXAMPLE + ```powershell Set-GitHubRepository -Name 'Hello-World' -Description 'My repo' + ``` Sets the repository `Hello-World` for the authenticated user if it does not exist, or updates it if it already exists. The repository uses GitHub's default settings. .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Name = 'Hello-World' @@ -25,6 +28,7 @@ DeleteBranchOnMerge = $true } Set-GitHubRepository @params + ``` Sets a repository using splatting for the configuration. diff --git a/src/functions/public/Repositories/Update-GitHubRepository.ps1 b/src/functions/public/Repositories/Update-GitHubRepository.ps1 index 615c1bb29..592cdfa54 100644 --- a/src/functions/public/Repositories/Update-GitHubRepository.ps1 +++ b/src/functions/public/Repositories/Update-GitHubRepository.ps1 @@ -8,9 +8,12 @@ [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint. .EXAMPLE + ```powershell Update-GitHubRepository -Name 'octocat' -Description 'Hello-World' -Homepage 'https://github.com' + ``` .EXAMPLE + ```powershell $params = @{ Owner = 'octocat' Name = 'Hello-World' @@ -19,6 +22,9 @@ Homepage = 'https://github.com' } Update-GitHubRepository @params + ``` + + Updates the repository `Hello-World` owned by `octocat` with a new name, description, and homepage URL. .INPUTS GitHubRepository diff --git a/src/functions/public/Secrets/Get-GitHubPublicKey.ps1 b/src/functions/public/Secrets/Get-GitHubPublicKey.ps1 index f92772834..6e03ff368 100644 --- a/src/functions/public/Secrets/Get-GitHubPublicKey.ps1 +++ b/src/functions/public/Secrets/Get-GitHubPublicKey.ps1 @@ -7,17 +7,23 @@ Gets your public key, which you need to encrypt secrets. .EXAMPLE + ```powershell Get-GitHubPublicKey + ``` Gets a public key for the authenticated user. .EXAMPLE + ```powershell Get-GitHubPublicKey -Organization 'octocat' + ``` Gets a public key for the 'octocat' organization. .EXAMPLE + ```powershell Get-GitHubPublicKey -Owner 'octocat' -Repository 'hello-world' -Type 'codespaces' + ``` Gets a public key for the 'hello-world' repository in the 'octocat' organization for codespaces. diff --git a/src/functions/public/Secrets/Get-GitHubSecret.ps1 b/src/functions/public/Secrets/Get-GitHubSecret.ps1 index 13c2adde2..899466e44 100644 --- a/src/functions/public/Secrets/Get-GitHubSecret.ps1 +++ b/src/functions/public/Secrets/Get-GitHubSecret.ps1 @@ -11,17 +11,23 @@ The function returns an array of PSObjects containing metadata about the secrets. .EXAMPLE + ```powershell Get-GitHubSecret -Owner PSModule -Repo Demo -Type actions + ``` Retrieves all Actions secrets from the 'Demo' repository under the 'PSModule' organization. .EXAMPLE + ```powershell Get-GitHubSecret -Owner PSModule -Type organization + ``` Retrieves all organization-level secrets under the 'PSModule' organization. .EXAMPLE + ```powershell Get-GitHubSecret -Owner PSModule -Repo Demo -Environment Staging + ``` Retrieves all secrets for the 'Staging' environment in the 'Demo' repository under 'PSModule'. diff --git a/src/functions/public/Secrets/Remove-GitHubSecret.ps1 b/src/functions/public/Secrets/Remove-GitHubSecret.ps1 index f5ea7b3eb..0d0aa5bd7 100644 --- a/src/functions/public/Secrets/Remove-GitHubSecret.ps1 +++ b/src/functions/public/Secrets/Remove-GitHubSecret.ps1 @@ -8,17 +8,23 @@ Supports both Actions and Codespaces secrets and requires appropriate authentication. .EXAMPLE + ```powershell Remove-GitHubSecret -Owner PSModule -Repository Demo -Type actions -Name TEST + ``` Deletes the secret named 'TEST' from the 'Demo' repository in the 'PSModule' organization. .EXAMPLE + ```powershell Remove-GitHubSecret -Organization MyOrg -Type actions -Name API_KEY + ``` Deletes the secret 'API_KEY' from the organization 'MyOrg'. .EXAMPLE + ```powershell Remove-GitHubSecret -Owner MyUser -Repository MyRepo -Environment Production -Name DB_PASSWORD + ``` Deletes the 'DB_PASSWORD' secret from the 'Production' environment in the 'MyRepo' repository. diff --git a/src/functions/public/Secrets/SelectedRepository/Add-GitHubSecretSelectedRepository.ps1 b/src/functions/public/Secrets/SelectedRepository/Add-GitHubSecretSelectedRepository.ps1 index 56ed38a60..0d7f260c0 100644 --- a/src/functions/public/Secrets/SelectedRepository/Add-GitHubSecretSelectedRepository.ps1 +++ b/src/functions/public/Secrets/SelectedRepository/Add-GitHubSecretSelectedRepository.ps1 @@ -11,7 +11,9 @@ and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell Add-GitHubSecretSelectedRepository -Owner 'my-org' -Name 'API_KEY' -RepositoryID '654321' + ``` Adds the repository 'test-repo' to the 'API_KEY' secret in the organization 'my-org'. diff --git a/src/functions/public/Secrets/SelectedRepository/Get-GitHubSecretSelectedRepository.ps1 b/src/functions/public/Secrets/SelectedRepository/Get-GitHubSecretSelectedRepository.ps1 index 21c00582d..a2f1aec95 100644 --- a/src/functions/public/Secrets/SelectedRepository/Get-GitHubSecretSelectedRepository.ps1 +++ b/src/functions/public/Secrets/SelectedRepository/Get-GitHubSecretSelectedRepository.ps1 @@ -9,7 +9,9 @@ need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. .EXAMPLE + ```powershell Get-GitHubSecretSelectedRepository -Owner 'octocat' -Name 'hello-world' + ``` Outputs: ```powershell diff --git a/src/functions/public/Secrets/SelectedRepository/Remove-GitHubSecretSelectedRepository.ps1 b/src/functions/public/Secrets/SelectedRepository/Remove-GitHubSecretSelectedRepository.ps1 index e4c97e672..fa3a95f6a 100644 --- a/src/functions/public/Secrets/SelectedRepository/Remove-GitHubSecretSelectedRepository.ps1 +++ b/src/functions/public/Secrets/SelectedRepository/Remove-GitHubSecretSelectedRepository.ps1 @@ -10,7 +10,9 @@ tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. .EXAMPLE + ```powershell Remove-GitHubSecretSelectedRepository -Owner 'my-org' -Name 'ENV_SECRET' -RepositoryID 123456 + ``` Removes repository with ID 123456 from the organization secret 'ENV_SECRET' in 'my-org'. diff --git a/src/functions/public/Secrets/SelectedRepository/Set-GitHubSecretSelectedRepository.ps1 b/src/functions/public/Secrets/SelectedRepository/Set-GitHubSecretSelectedRepository.ps1 index c82c5c0ce..e8ad87c82 100644 --- a/src/functions/public/Secrets/SelectedRepository/Set-GitHubSecretSelectedRepository.ps1 +++ b/src/functions/public/Secrets/SelectedRepository/Set-GitHubSecretSelectedRepository.ps1 @@ -10,7 +10,9 @@ tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. .EXAMPLE + ```powershell Set-GitHubSecretSelectedRepository -Owner 'octocat' -Name 'mysecret' -RepositoryID 1234567890 + ``` Sets the selected repositories for the secret `mysecret` in the organization `octocat` to the repository with ID `1234567890`. diff --git a/src/functions/public/Secrets/Set-GitHubSecret.ps1 b/src/functions/public/Secrets/Set-GitHubSecret.ps1 index c1da2a007..c622abc46 100644 --- a/src/functions/public/Secrets/Set-GitHubSecret.ps1 +++ b/src/functions/public/Secrets/Set-GitHubSecret.ps1 @@ -8,12 +8,15 @@ It encrypts the secret value before storing it and supports different visibility levels. .EXAMPLE + ```powershell $secret = ConvertTo-SecureString "my-secret-value" -AsPlainText -Force Set-GitHubSecret -Repository 'MyRepo' -Owner 'MyUser' -Name 'MySecret' -Value $secret + ``` Updates the secret `MySecret` in the `MyRepo` repository for the owner `MyUser`. .EXAMPLE + ```powershell $params = @{ Organization = 'MyOrg' Name = 'MySecret' @@ -22,10 +25,12 @@ Visibility = 'Private' } Set-GitHubSecret @params + ``` Updates the secret `MySecret` at the organization level for GitHub Actions, setting visibility to private. .EXAMPLE + ```powershell $params = @{ Owner = 'MyUser' Repository = 'MyRepo' @@ -34,6 +39,7 @@ Value = (ConvertTo-SecureString "my-secret-value" -AsPlainText -Force) } Set-GitHubSecret @params + ``` Updates the secret `MySecret` in the `Production` environment of the `MyRepo` repository for `MyUser`. diff --git a/src/functions/public/Status/Get-GitHubScheduledMaintenance.ps1 b/src/functions/public/Status/Get-GitHubScheduledMaintenance.ps1 index df799f233..cdf08cde3 100644 --- a/src/functions/public/Status/Get-GitHubScheduledMaintenance.ps1 +++ b/src/functions/public/Status/Get-GitHubScheduledMaintenance.ps1 @@ -13,18 +13,24 @@ Impact: None (black), Minor (yellow), Major (orange), or Critical (red) .EXAMPLE + ```powershell Get-GitHubScheduledMaintenance + ``` Get a list of the 50 most recent scheduled maintenances. This includes scheduled maintenances as described in the above two endpoints, as well as those in the Completed state. .EXAMPLE + ```powershell Get-GitHubScheduledMaintenance -Active + ``` Get a list of any active maintenances. .EXAMPLE + ```powershell Get-GitHubScheduledMaintenance -Upcoming + ``` Get a list of any upcoming maintenances. diff --git a/src/functions/public/Status/Get-GitHubStatus.ps1 b/src/functions/public/Status/Get-GitHubStatus.ps1 index 8a0072f1b..94ac1dec6 100644 --- a/src/functions/public/Status/Get-GitHubStatus.ps1 +++ b/src/functions/public/Status/Get-GitHubStatus.ps1 @@ -11,12 +11,16 @@ and "Major Service Outage". .EXAMPLE + ```powershell Get-GitHubStatus + ``` Gets the status of GitHub services .EXAMPLE + ```powershell Get-GitHubStatus -Summary + ``` Gets a summary of the status page, including a status indicator, component statuses, unresolved incidents, and any upcoming or in-progress scheduled maintenances. diff --git a/src/functions/public/Status/Get-GitHubStatusComponent.ps1 b/src/functions/public/Status/Get-GitHubStatusComponent.ps1 index 130c5af14..10d341740 100644 --- a/src/functions/public/Status/Get-GitHubStatusComponent.ps1 +++ b/src/functions/public/Status/Get-GitHubStatusComponent.ps1 @@ -8,7 +8,9 @@ degraded_performance, partial_outage, or major_outage. .EXAMPLE + ```powershell Get-GitHubStatusComponent + ``` Gets the status of GitHub components diff --git a/src/functions/public/Status/Get-GitHubStatusIncident.ps1 b/src/functions/public/Status/Get-GitHubStatusIncident.ps1 index 146c88f94..fc89706de 100644 --- a/src/functions/public/Status/Get-GitHubStatusIncident.ps1 +++ b/src/functions/public/Status/Get-GitHubStatusIncident.ps1 @@ -12,12 +12,16 @@ Impact: None (black), Minor (yellow), Major (orange), or Critical (red) .EXAMPLE + ```powershell Get-GitHubStatusIncident + ``` Gets the status of GitHub incidents .EXAMPLE + ```powershell Get-GitHubStatusIncident -Unresolved + ``` Gets the status of GitHub incidents that are unresolved diff --git a/src/functions/public/Teams/Get-GitHubTeam.ps1 b/src/functions/public/Teams/Get-GitHubTeam.ps1 index befe3fd55..425f5df65 100644 --- a/src/functions/public/Teams/Get-GitHubTeam.ps1 +++ b/src/functions/public/Teams/Get-GitHubTeam.ps1 @@ -9,17 +9,23 @@ and replaces spaces with a - separator. For example, "My TEam Näme" would become my-team-name. .EXAMPLE + ```powershell Get-GitHubTeam -Organization 'GitHub' + ``` Gets all teams in the `github` organization. .EXAMPLE + ```powershell Get-GitHubTeam -Organization 'github' -Slug 'my-team-name' + ``` Gets the team with the slug 'my-team-name' in the `github` organization. .EXAMPLE + ```powershell Get-GitHubTeam -Organization 'github' -Repository 'my-repo' + ``` Lists all teams that have access to the 'my-repo' repository owned by `github`. diff --git a/src/functions/public/Teams/New-GitHubTeam.ps1 b/src/functions/public/Teams/New-GitHubTeam.ps1 index 05f4178a1..58bf83596 100644 --- a/src/functions/public/Teams/New-GitHubTeam.ps1 +++ b/src/functions/public/Teams/New-GitHubTeam.ps1 @@ -13,6 +13,7 @@ "[About teams](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-teams)". .EXAMPLE + ```powershell $params = @{ Organization = 'github' Name = 'team-name' @@ -21,6 +22,7 @@ Notifications = $true } New-GitHubTeam @params + ``` .LINK https://psmodule.io/GitHub/Functions/Teams/New-GitHubTeam diff --git a/src/functions/public/Teams/Remove-GitHubTeam.ps1 b/src/functions/public/Teams/Remove-GitHubTeam.ps1 index b795eca9a..c95fa09b2 100644 --- a/src/functions/public/Teams/Remove-GitHubTeam.ps1 +++ b/src/functions/public/Teams/Remove-GitHubTeam.ps1 @@ -8,7 +8,9 @@ If you are an organization owner, deleting a parent team will delete all of its child teams as well. .EXAMPLE + ```powershell Remove-GitHubTeam -Organization 'github' -Name 'team-name' + ``` .NOTES [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) diff --git a/src/functions/public/Teams/Update-GitHubTeam.ps1 b/src/functions/public/Teams/Update-GitHubTeam.ps1 index 642122513..fe12bb107 100644 --- a/src/functions/public/Teams/Update-GitHubTeam.ps1 +++ b/src/functions/public/Teams/Update-GitHubTeam.ps1 @@ -7,6 +7,7 @@ To edit a team, the authenticated user must either be an organization owner or a team maintainer. .EXAMPLE + ```powershell $params = @{ Organization = 'github' Slug = 'team-name' @@ -17,6 +18,7 @@ ParentTeamID = 123456 } Update-GitHubTeam @params + ``` Updates the team with the slug 'team-name' in the `github` organization with the new name 'new team name', description 'A new team', visibility set to 'closed', notifications enabled, and the parent team ID set to 123456. diff --git a/src/functions/public/Users/Blocking/Block-GitHubUser.ps1 b/src/functions/public/Users/Blocking/Block-GitHubUser.ps1 index 641d5b63a..600d750a2 100644 --- a/src/functions/public/Users/Blocking/Block-GitHubUser.ps1 +++ b/src/functions/public/Users/Blocking/Block-GitHubUser.ps1 @@ -8,13 +8,17 @@ If the user cannot be blocked false is returned. .EXAMPLE + ```powershell Block-GitHubUser -Username 'octocat' + ``` Blocks the user 'octocat' for the authenticated user. Returns $true if successful, $false if not. .EXAMPLE + ```powershell Block-GitHubUser -Organization 'GitHub' -Username 'octocat' + ``` Blocks the user 'octocat' from the organization 'GitHub'. Returns $true if successful, $false if not. diff --git a/src/functions/public/Users/Blocking/Get-GitHubBlockedUser.ps1 b/src/functions/public/Users/Blocking/Get-GitHubBlockedUser.ps1 index 70b16658e..5be098951 100644 --- a/src/functions/public/Users/Blocking/Get-GitHubBlockedUser.ps1 +++ b/src/functions/public/Users/Blocking/Get-GitHubBlockedUser.ps1 @@ -7,12 +7,16 @@ List the users that are blocked on your personal account or a given organization. .EXAMPLE + ```powershell Get-GitHubBlockedUser + ``` Returns a list of users blocked by the authenticated user. .EXAMPLE + ```powershell Get-GitHubBlockedUser -Organization 'github' + ``` Lists all users blocked by the organization `github`. diff --git a/src/functions/public/Users/Blocking/Test-GitHubBlockedUser.ps1 b/src/functions/public/Users/Blocking/Test-GitHubBlockedUser.ps1 index 831ad3ed2..0d876e061 100644 --- a/src/functions/public/Users/Blocking/Test-GitHubBlockedUser.ps1 +++ b/src/functions/public/Users/Blocking/Test-GitHubBlockedUser.ps1 @@ -8,13 +8,17 @@ Returns a 404 if the given user is not blocked, or if the given user account has been identified as spam by GitHub. .EXAMPLE + ```powershell Test-GitHubBlockedUser -Username 'octocat' + ``` Checks if the user `octocat` is blocked by the authenticated user. Returns true if the user is blocked, false if not. .EXAMPLE + ```powershell Test-GitHubBlockedUser -Organization 'github' -Username 'octocat' + ``` Checks if the user `octocat` is blocked by the organization `github`. Returns true if the user is blocked, false if not. diff --git a/src/functions/public/Users/Blocking/Unblock-GitHubUser.ps1 b/src/functions/public/Users/Blocking/Unblock-GitHubUser.ps1 index 1f731eeeb..f242b36e1 100644 --- a/src/functions/public/Users/Blocking/Unblock-GitHubUser.ps1 +++ b/src/functions/public/Users/Blocking/Unblock-GitHubUser.ps1 @@ -7,13 +7,17 @@ Unblocks the given user and returns true. .EXAMPLE + ```powershell Unblock-GitHubUser -Username 'octocat' + ``` Unblocks the user 'octocat' for the authenticated user. Returns $true if successful. .EXAMPLE + ```powershell Unblock-GitHubUser -Organization 'GitHub' -Username 'octocat' + ``` Unblocks the user 'octocat' from the organization 'GitHub'. Returns $true if successful. diff --git a/src/functions/public/Users/Emails/Add-GitHubUserEmail.ps1 b/src/functions/public/Users/Emails/Add-GitHubUserEmail.ps1 index 1ee277e8d..4c9ab4cc8 100644 --- a/src/functions/public/Users/Emails/Add-GitHubUserEmail.ps1 +++ b/src/functions/public/Users/Emails/Add-GitHubUserEmail.ps1 @@ -7,7 +7,9 @@ This endpoint is accessible with the `user` scope. .EXAMPLE + ```powershell Add-GitHubUserEmail -Email 'octocat@github.com','firstname.lastname@work.com' + ``` Adds the email addresses `octocat@github.com` and `firstname.lastname@work.com` to the authenticated user's account. diff --git a/src/functions/public/Users/Emails/Get-GitHubUserEmail.ps1 b/src/functions/public/Users/Emails/Get-GitHubUserEmail.ps1 index 2fc0df686..55762c404 100644 --- a/src/functions/public/Users/Emails/Get-GitHubUserEmail.ps1 +++ b/src/functions/public/Users/Emails/Get-GitHubUserEmail.ps1 @@ -9,12 +9,16 @@ authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user) endpoint. .EXAMPLE + ```powershell Get-GitHubUserEmail + ``` Gets all email addresses for the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserEmail -Public + ``` Gets the publicly visible email address for the authenticated user. diff --git a/src/functions/public/Users/Emails/Remove-GitHubUserEmail.ps1 b/src/functions/public/Users/Emails/Remove-GitHubUserEmail.ps1 index 2a7ed95ec..88824904d 100644 --- a/src/functions/public/Users/Emails/Remove-GitHubUserEmail.ps1 +++ b/src/functions/public/Users/Emails/Remove-GitHubUserEmail.ps1 @@ -7,7 +7,9 @@ This endpoint is accessible with the `user` scope. .EXAMPLE + ```powershell Remove-GitHubUserEmail -Emails 'octocat@github.com','firstname.lastname@work.com' + ``` Removes the email addresses `octocat@github.com` and `firstname.lastname@work.com` from the authenticated user's account. diff --git a/src/functions/public/Users/Emails/Update-GitHubUserEmailVisibility.ps1 b/src/functions/public/Users/Emails/Update-GitHubUserEmailVisibility.ps1 index 67ee2bb42..a849dccce 100644 --- a/src/functions/public/Users/Emails/Update-GitHubUserEmailVisibility.ps1 +++ b/src/functions/public/Users/Emails/Update-GitHubUserEmailVisibility.ps1 @@ -7,12 +7,16 @@ Sets the visibility for your primary email addresses. .EXAMPLE + ```powershell Set-GitHubUserEmailVisibility -Visibility Public + ``` Sets the visibility for your primary email addresses to public. .EXAMPLE + ```powershell Set-GitHubUserEmailVisibility -Visibility Private + ``` Sets the visibility for your primary email addresses to private. diff --git a/src/functions/public/Users/Followers/Add-GitHubUserFollowing.ps1 b/src/functions/public/Users/Followers/Add-GitHubUserFollowing.ps1 index b0f73ecb3..94d778a6a 100644 --- a/src/functions/public/Users/Followers/Add-GitHubUserFollowing.ps1 +++ b/src/functions/public/Users/Followers/Add-GitHubUserFollowing.ps1 @@ -9,7 +9,9 @@ Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. .EXAMPLE + ```powershell Follow-GitHubUser -Username 'octocat' + ``` Follows the user with the username 'octocat'. diff --git a/src/functions/public/Users/Followers/Get-GitHubUserFollower.ps1 b/src/functions/public/Users/Followers/Get-GitHubUserFollower.ps1 index 998df8a93..f0054161b 100644 --- a/src/functions/public/Users/Followers/Get-GitHubUserFollower.ps1 +++ b/src/functions/public/Users/Followers/Get-GitHubUserFollower.ps1 @@ -7,12 +7,16 @@ Lists the people following a given user or the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserFollower + ``` Gets all followers of the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserFollower -Username 'octocat' + ``` Gets all followers of the user 'octocat'. diff --git a/src/functions/public/Users/Followers/Get-GitHubUserFollowing.ps1 b/src/functions/public/Users/Followers/Get-GitHubUserFollowing.ps1 index e24b7719f..c60c6678c 100644 --- a/src/functions/public/Users/Followers/Get-GitHubUserFollowing.ps1 +++ b/src/functions/public/Users/Followers/Get-GitHubUserFollowing.ps1 @@ -7,12 +7,16 @@ Lists the people who a given user or the authenticated user follows. .EXAMPLE + ```powershell Get-GitHubUserFollowing + ``` Gets all people the authenticated user follows. .EXAMPLE + ```powershell Get-GitHubUserFollowing -Username 'octocat' + ``` Gets all people that 'octocat' follows. diff --git a/src/functions/public/Users/Followers/Remove-GitHubUserFollowing.ps1 b/src/functions/public/Users/Followers/Remove-GitHubUserFollowing.ps1 index 2b55d921c..56f6ec2b6 100644 --- a/src/functions/public/Users/Followers/Remove-GitHubUserFollowing.ps1 +++ b/src/functions/public/Users/Followers/Remove-GitHubUserFollowing.ps1 @@ -7,7 +7,9 @@ Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. .EXAMPLE + ```powershell Unfollow-GitHubUser -Username 'octocat' + ``` Unfollows the user with the username 'octocat'. diff --git a/src/functions/public/Users/Followers/Test-GitHubUserFollowing.ps1 b/src/functions/public/Users/Followers/Test-GitHubUserFollowing.ps1 index 546698f3c..70534827d 100644 --- a/src/functions/public/Users/Followers/Test-GitHubUserFollowing.ps1 +++ b/src/functions/public/Users/Followers/Test-GitHubUserFollowing.ps1 @@ -8,13 +8,17 @@ Returns a 404 if the user is not followed by a given user or the authenticated user. .EXAMPLE + ```powershell Test-GitHubUserFollowing -Follows 'octocat' Test-GitHubUserFollowing 'octocat' + ``` Checks if the authenticated user follows the user 'octocat'. .EXAMPLE + ```powershell Test-GitHubUserFollowing -Username 'octocat' -Follows 'ratstallion' + ``` Checks if the user 'octocat' follows the user 'ratstallion'. diff --git a/src/functions/public/Users/GPG-Keys/Add-GitHubUserGpgKey.ps1 b/src/functions/public/Users/GPG-Keys/Add-GitHubUserGpgKey.ps1 index 3fcfc38df..599735083 100644 --- a/src/functions/public/Users/GPG-Keys/Add-GitHubUserGpgKey.ps1 +++ b/src/functions/public/Users/GPG-Keys/Add-GitHubUserGpgKey.ps1 @@ -9,9 +9,11 @@ [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE + ```powershell Add-GitHubUserGpgKey -Name 'GPG key for GitHub' -ArmoredPublicKey @' -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 + ``` mQINBFnZ2ZIBEADQ2Z7Z7 -----END PGP PUBLIC KEY BLOCK----- diff --git a/src/functions/public/Users/GPG-Keys/Get-GitHubUserGpgKey.ps1 b/src/functions/public/Users/GPG-Keys/Get-GitHubUserGpgKey.ps1 index 9a1fc348a..7c136b13b 100644 --- a/src/functions/public/Users/GPG-Keys/Get-GitHubUserGpgKey.ps1 +++ b/src/functions/public/Users/GPG-Keys/Get-GitHubUserGpgKey.ps1 @@ -7,17 +7,23 @@ Lists a given user's or the current user's GPG keys. .EXAMPLE + ```powershell Get-GitHubUserGpgKey + ``` Gets all GPG keys for the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserGpgKey -ID '1234567' + ``` Gets the GPG key with ID '1234567' for the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserGpgKey -Username 'octocat' + ``` Gets all GPG keys for the 'octocat' user. diff --git a/src/functions/public/Users/GPG-Keys/Remove-GitHubUserGpgKey.ps1 b/src/functions/public/Users/GPG-Keys/Remove-GitHubUserGpgKey.ps1 index b577a1fff..ee54e70e0 100644 --- a/src/functions/public/Users/GPG-Keys/Remove-GitHubUserGpgKey.ps1 +++ b/src/functions/public/Users/GPG-Keys/Remove-GitHubUserGpgKey.ps1 @@ -1,4 +1,4 @@ -filter Remove-GitHubUserGpgKey { +filter Remove-GitHubUserGpgKey { <# .SYNOPSIS Delete a GPG key for the authenticated user @@ -9,7 +9,9 @@ filter Remove-GitHubUserGpgKey { [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE + ```powershell Remove-GitHubUserGpgKey -ID '1234567' + ``` Gets the GPG key with ID '1234567' for the authenticated user. diff --git a/src/functions/public/Users/Get-GitHubUser.ps1 b/src/functions/public/Users/Get-GitHubUser.ps1 index 4e84bbf74..e7fe41c15 100644 --- a/src/functions/public/Users/Get-GitHubUser.ps1 +++ b/src/functions/public/Users/Get-GitHubUser.ps1 @@ -9,17 +9,23 @@ Lists all users, in the order that they signed up on GitHub - if '-All' is provided. .EXAMPLE + ```powershell Get-GitHubUser + ``` Get the authenticated user. .EXAMPLE + ```powershell Get-GitHubUser -Name 'octocat' + ``` Get the 'octocat' user. .EXAMPLE + ```powershell Get-GitHubUser -All -Since 17722253 + ``` Get a list of users, starting with the user 'MariusStorhaug'. diff --git a/src/functions/public/Users/Keys/Add-GitHubUserKey.ps1 b/src/functions/public/Users/Keys/Add-GitHubUserKey.ps1 index e16740d1d..e3e99bb0d 100644 --- a/src/functions/public/Users/Keys/Add-GitHubUserKey.ps1 +++ b/src/functions/public/Users/Keys/Add-GitHubUserKey.ps1 @@ -9,7 +9,9 @@ [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE + ```powershell Add-GitHubUserKey -Title 'ssh-rsa AAAAB3NzaC1yc2EAAA' -Key '2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234' + ``` Adds a new public SSH key to the authenticated user's GitHub account. diff --git a/src/functions/public/Users/Keys/Get-GitHubUserKey.ps1 b/src/functions/public/Users/Keys/Get-GitHubUserKey.ps1 index 69145a9d7..113561613 100644 --- a/src/functions/public/Users/Keys/Get-GitHubUserKey.ps1 +++ b/src/functions/public/Users/Keys/Get-GitHubUserKey.ps1 @@ -10,17 +10,23 @@ Keys from a given user are accessible by anyone. .EXAMPLE + ```powershell Get-GitHubUserKey + ``` Gets all GPG keys for the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserKey -ID '1234567' + ``` Gets the public SSH key with the ID '1234567' for the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserKey -Username 'octocat' + ``` Gets all GPG keys for the 'octocat' user. diff --git a/src/functions/public/Users/Keys/Remove-GitHubUserKey.ps1 b/src/functions/public/Users/Keys/Remove-GitHubUserKey.ps1 index 661cc342d..efd37ffc1 100644 --- a/src/functions/public/Users/Keys/Remove-GitHubUserKey.ps1 +++ b/src/functions/public/Users/Keys/Remove-GitHubUserKey.ps1 @@ -1,4 +1,4 @@ -filter Remove-GitHubUserKey { +filter Remove-GitHubUserKey { <# .SYNOPSIS Delete a public SSH key for the authenticated user @@ -9,7 +9,9 @@ filter Remove-GitHubUserKey { [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). .EXAMPLE + ```powershell Remove-GitHubUserKey -ID '1234567' + ``` Deletes the public SSH key with ID '1234567' from the authenticated user's GitHub account. diff --git a/src/functions/public/Users/SSH-Signing-Keys/Add-GitHubUserSigningKey.ps1 b/src/functions/public/Users/SSH-Signing-Keys/Add-GitHubUserSigningKey.ps1 index 648782a91..75336526b 100644 --- a/src/functions/public/Users/SSH-Signing-Keys/Add-GitHubUserSigningKey.ps1 +++ b/src/functions/public/Users/SSH-Signing-Keys/Add-GitHubUserSigningKey.ps1 @@ -10,7 +10,9 @@ "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." .EXAMPLE + ```powershell Add-GitHubUserSigningKey -Title 'ssh-rsa AAAAB3NzaC1yc2EAAA' -Key '2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234' + ``` Creates a new SSH signing key for the authenticated user's GitHub account. diff --git a/src/functions/public/Users/SSH-Signing-Keys/Get-GitHubUserSigningKey.ps1 b/src/functions/public/Users/SSH-Signing-Keys/Get-GitHubUserSigningKey.ps1 index 1b6da1cdc..43e4bb241 100644 --- a/src/functions/public/Users/SSH-Signing-Keys/Get-GitHubUserSigningKey.ps1 +++ b/src/functions/public/Users/SSH-Signing-Keys/Get-GitHubUserSigningKey.ps1 @@ -7,17 +7,23 @@ Lists a given user's or the current user's SSH signing keys. .EXAMPLE + ```powershell Get-GitHubUserSigningKey + ``` Gets all SSH signing keys for the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserSigningKey -ID '1234567' + ``` Gets the SSH signing key with the ID '1234567' for the authenticated user. .EXAMPLE + ```powershell Get-GitHubUserSigningKey -Username 'octocat' + ``` Gets all SSH signing keys for the 'octocat' user. diff --git a/src/functions/public/Users/SSH-Signing-Keys/Remove-GitHubUserSigningKey.ps1 b/src/functions/public/Users/SSH-Signing-Keys/Remove-GitHubUserSigningKey.ps1 index f9fdd5154..6689e6125 100644 --- a/src/functions/public/Users/SSH-Signing-Keys/Remove-GitHubUserSigningKey.ps1 +++ b/src/functions/public/Users/SSH-Signing-Keys/Remove-GitHubUserSigningKey.ps1 @@ -1,4 +1,4 @@ -filter Remove-GitHubUserSigningKey { +filter Remove-GitHubUserSigningKey { <# .SYNOPSIS Delete an SSH signing key for the authenticated user @@ -10,7 +10,9 @@ filter Remove-GitHubUserSigningKey { "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)." .EXAMPLE + ```powershell Remove-GitHubUserSigningKey -ID '1234567' + ``` Removes the SSH signing key with the ID of `1234567` from the authenticated user's GitHub account. diff --git a/src/functions/public/Users/Social-Accounts/Add-GitHubUserSocial.ps1 b/src/functions/public/Users/Social-Accounts/Add-GitHubUserSocial.ps1 index 3dda88403..6ec4194bb 100644 --- a/src/functions/public/Users/Social-Accounts/Add-GitHubUserSocial.ps1 +++ b/src/functions/public/Users/Social-Accounts/Add-GitHubUserSocial.ps1 @@ -7,7 +7,9 @@ Add one or more social accounts to the authenticated user's profile. This endpoint is accessible with the `user` scope. .EXAMPLE + ```powershell Add-GitHubUserSocial -AccountUrls 'https://twitter.com/MyTwitterAccount', 'https://www.linkedin.com/company/MyCompany' + ``` Adds the Twitter and LinkedIn accounts to the authenticated user's profile. diff --git a/src/functions/public/Users/Social-Accounts/Remove-GitHubUserSocial.ps1 b/src/functions/public/Users/Social-Accounts/Remove-GitHubUserSocial.ps1 index eaaa15fa6..c93ea972a 100644 --- a/src/functions/public/Users/Social-Accounts/Remove-GitHubUserSocial.ps1 +++ b/src/functions/public/Users/Social-Accounts/Remove-GitHubUserSocial.ps1 @@ -6,11 +6,10 @@ .DESCRIPTION Deletes one or more social accounts from the authenticated user's profile. This endpoint is accessible with the `user` scope. - .PARAMETER AccountUrls - Parameter description - .EXAMPLE + ```powershell Remove-GitHubUserSocial -AccountUrls 'https://twitter.com/MyTwitterAccount' + ``` .NOTES [Delete social accounts for the authenticated user](https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user) diff --git a/src/functions/public/Users/Update-GitHubUser.ps1 b/src/functions/public/Users/Update-GitHubUser.ps1 index 4f97098ec..c6b29121a 100644 --- a/src/functions/public/Users/Update-GitHubUser.ps1 +++ b/src/functions/public/Users/Update-GitHubUser.ps1 @@ -9,17 +9,23 @@ displayed on your public profile or via the API. .EXAMPLE + ```powershell Update-GitHubUser -Name 'octocat' + ``` Update the authenticated user's name to 'octocat' .EXAMPLE + ```powershell Update-GitHubUser -Location 'San Francisco' + ``` Update the authenticated user's location to 'San Francisco' .EXAMPLE + ```powershell Update-GitHubUser -Hireable $true -Description 'I love programming' + ``` Update the authenticated user's hiring availability to 'true' and their description to 'I love programming' diff --git a/src/functions/public/Variables/Export-GitHubVariable.ps1 b/src/functions/public/Variables/Export-GitHubVariable.ps1 index 8280f7808..744d24977 100644 --- a/src/functions/public/Variables/Export-GitHubVariable.ps1 +++ b/src/functions/public/Variables/Export-GitHubVariable.ps1 @@ -12,7 +12,9 @@ The function accepts pipeline input, allowing GitHub variables retrieved using `Get-GitHubVariable` to be exported seamlessly. .EXAMPLE + ```powershell Get-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Environment 'staging' | Export-GitHubVariable + ``` Exports the variables retrieved from the GitHub API to the local environment. diff --git a/src/functions/public/Variables/Get-GitHubVariable.ps1 b/src/functions/public/Variables/Get-GitHubVariable.ps1 index e582c014a..9f1c09088 100644 --- a/src/functions/public/Variables/Get-GitHubVariable.ps1 +++ b/src/functions/public/Variables/Get-GitHubVariable.ps1 @@ -11,7 +11,9 @@ `admin:org` for organizations, and collaborator access for environments. .EXAMPLE + ```powershell Get-GitHubVariable -Owner 'octocat' -Name 'HOST_NAME' + ``` Output: ```powershell @@ -25,7 +27,9 @@ Retrieves the specified variable from the organization level. .EXAMPLE + ```powershell Get-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Name 'GUID' + ``` Output: ```powershell @@ -39,7 +43,9 @@ Retrieves the specified variable from the repository level. .EXAMPLE + ```powershell Get-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Name 'DB_SERVER' + ``` Output: ```powershell @@ -53,7 +59,9 @@ Retrieves the specified variable from the environment level within a repository. .EXAMPLE + ```powershell Get-GitHubVariable -Owner 'octocat' + ``` Output: ```powershell @@ -73,7 +81,9 @@ Retrieves all variables available at the organization level. .EXAMPLE + ```powershell Get-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' + ``` Output: ```powershell @@ -93,7 +103,9 @@ Retrieves all variables available at the repository level. .EXAMPLE + ```powershell Get-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Environment 'staging' + ``` Output: ```powershell diff --git a/src/functions/public/Variables/New-GitHubVariable.ps1 b/src/functions/public/Variables/New-GitHubVariable.ps1 index bba5c9cf0..5ecaf5d5c 100644 --- a/src/functions/public/Variables/New-GitHubVariable.ps1 +++ b/src/functions/public/Variables/New-GitHubVariable.ps1 @@ -13,18 +13,24 @@ - Environment-level variables require collaborator access to the repository. .EXAMPLE + ```powershell New-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Name 'HOST_NAME' -Value 'github.com' -Context $GitHubContext + ``` Creates a new repository variable named `HOST_NAME` with the value `github.com` in the specified repository. .EXAMPLE + ```powershell New-GitHubVariable -Owner 'octocat' -Name 'HOST_NAME' -Value 'github.com' -Visibility 'all' -Context $GitHubContext + ``` Creates a new organization variable named `HOST_NAME` with the value `github.com` and makes it available to all repositories in the organization. .EXAMPLE + ```powershell New-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Name 'HOST_NAME' -Value 'github.com' -Context $GitHubContext + ``` Creates a new environment variable named `HOST_NAME` with the value `github.com` in the specified environment. diff --git a/src/functions/public/Variables/Remove-GitHubVariable.ps1 b/src/functions/public/Variables/Remove-GitHubVariable.ps1 index 578ad371c..b3758fac4 100644 --- a/src/functions/public/Variables/Remove-GitHubVariable.ps1 +++ b/src/functions/public/Variables/Remove-GitHubVariable.ps1 @@ -14,17 +14,23 @@ - `repo` for repository and environment-level variables. .EXAMPLE + ```powershell Get-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' | Remove-GitHubVariable + ``` Removes all variables retrieved from the specified repository. .EXAMPLE + ```powershell Remove-GitHubVariable -Owner 'octocat' -Name 'HOST_NAME' -Context $GitHubContext + ``` Deletes the specified variable from the specified organization. .EXAMPLE + ```powershell Remove-GitHubVariable -Variable $variablesArray + ``` Removes all variables provided in the array. diff --git a/src/functions/public/Variables/SelectedRepository/Add-GitHubVariableSelectedRepository.ps1 b/src/functions/public/Variables/SelectedRepository/Add-GitHubVariableSelectedRepository.ps1 index 37ce7cfcf..f8362ffbb 100644 --- a/src/functions/public/Variables/SelectedRepository/Add-GitHubVariableSelectedRepository.ps1 +++ b/src/functions/public/Variables/SelectedRepository/Add-GitHubVariableSelectedRepository.ps1 @@ -11,7 +11,9 @@ Fine-grained tokens must have 'Variables' organization permission (write) and 'Metadata' repository permission (read). .EXAMPLE + ```powershell Add-GitHubVariableSelectedRepository -Owner 'my-org' -Name 'API_KEY' -RepositoryID '654321' + ``` Adds the repository 'test-repo' to the 'API_KEY' variable in the organization 'my-org'. diff --git a/src/functions/public/Variables/SelectedRepository/Get-GitHubVariableSelectedRepository.ps1 b/src/functions/public/Variables/SelectedRepository/Get-GitHubVariableSelectedRepository.ps1 index 6947ef247..86cf75ed1 100644 --- a/src/functions/public/Variables/SelectedRepository/Get-GitHubVariableSelectedRepository.ps1 +++ b/src/functions/public/Variables/SelectedRepository/Get-GitHubVariableSelectedRepository.ps1 @@ -10,7 +10,9 @@ the `repo` scope is also required. .EXAMPLE + ```powershell Get-GitHubVariableSelectedRepository -Owner 'PSModule' -Name 'SELECTEDVAR' + ``` .OUTPUTS GitHubRepository diff --git a/src/functions/public/Variables/SelectedRepository/Remove-GitHubVariableSelectedRepository.ps1 b/src/functions/public/Variables/SelectedRepository/Remove-GitHubVariableSelectedRepository.ps1 index a81a40bac..ceb4201f7 100644 --- a/src/functions/public/Variables/SelectedRepository/Remove-GitHubVariableSelectedRepository.ps1 +++ b/src/functions/public/Variables/SelectedRepository/Remove-GitHubVariableSelectedRepository.ps1 @@ -16,7 +16,9 @@ 'Metadata' repository permissions (read). .EXAMPLE + ```powershell Remove-GitHubVariableSelectedRepository -Owner 'my-org' -Name 'ENV_SECRET' -RepositoryID 123456 + ``` Removes repository with ID 123456 from the organization variable 'ENV_SECRET' in 'my-org'. diff --git a/src/functions/public/Variables/SelectedRepository/Set-GitHubVariableSelectedRepository.ps1 b/src/functions/public/Variables/SelectedRepository/Set-GitHubVariableSelectedRepository.ps1 index 24e99861b..9dca48517 100644 --- a/src/functions/public/Variables/SelectedRepository/Set-GitHubVariableSelectedRepository.ps1 +++ b/src/functions/public/Variables/SelectedRepository/Set-GitHubVariableSelectedRepository.ps1 @@ -10,6 +10,11 @@ OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. .EXAMPLE + ```powershell + Set-GitHubVariableSelectedRepository -Owner 'octocat' -Name 'MY_VARIABLE' -RepositoryID 12345678, 87654321 -Context (Get-GitHubContext) + ``` + + This command sets the repositories with IDs 12345678 and 87654321 to have access to the organization variable 'MY_VARIABLE' in the organization owned by 'octocat'. .LINK https://psmodule.io/GitHub/Functions/Variables/SelectedRepository/Set-GitHubVariableSelectedRepository diff --git a/src/functions/public/Variables/Set-GitHubVariable.ps1 b/src/functions/public/Variables/Set-GitHubVariable.ps1 index 83f9de664..8d87264a8 100644 --- a/src/functions/public/Variables/Set-GitHubVariable.ps1 +++ b/src/functions/public/Variables/Set-GitHubVariable.ps1 @@ -13,18 +13,24 @@ - Environment-level variables require collaborator access to the repository. .EXAMPLE + ```powershell Set-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Name 'HOST_NAME' -Value 'github.com' -Context $GitHubContext + ``` Creates or updates a repository variable named `HOST_NAME` with the value `github.com` in the specified repository. .EXAMPLE + ```powershell Set-GitHubVariable -Owner 'octocat' -Name 'HOST_NAME' -Value 'github.com' -Visibility 'all' -Context $GitHubContext + ``` Creates or updates an organization variable named `HOST_NAME` with the value `github.com` and makes it available to all repositories in the organization. .EXAMPLE + ```powershell Set-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Name 'HOST_NAME' -Value 'github.com' -Context $GitHubContext + ``` Creates or updates an environment variable named `HOST_NAME` with the value `github.com` in the specified environment. diff --git a/src/functions/public/Variables/Update-GitHubVariable.ps1 b/src/functions/public/Variables/Update-GitHubVariable.ps1 index 74bf59393..568eadcc7 100644 --- a/src/functions/public/Variables/Update-GitHubVariable.ps1 +++ b/src/functions/public/Variables/Update-GitHubVariable.ps1 @@ -12,17 +12,23 @@ and environment variables require collaborator access. .EXAMPLE + ```powershell Update-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Name 'HOST_NAME' -Value 'github.com' + ``` Updates the repository variable named `HOST_NAME` with the value `github.com` in the specified repository. .EXAMPLE + ```powershell Update-GitHubVariable -Owner 'octocat' -Name 'HOST_NAME' -Value 'github.com' -Visibility 'private' + ``` Updates the organization variable named `HOST_NAME` with the value `github.com`, making it private. .EXAMPLE + ```powershell Update-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' -Environment 'dev' -Name 'HOST_NAME' -Value 'github.com' + ``` Updates the environment variable named `HOST_NAME` with the value `github.com` in the specified environment. diff --git a/src/functions/public/Webhooks/Get-GitHubAppWebhookConfiguration.ps1 b/src/functions/public/Webhooks/Get-GitHubAppWebhookConfiguration.ps1 index cfaa54435..22dedc17e 100644 --- a/src/functions/public/Webhooks/Get-GitHubAppWebhookConfiguration.ps1 +++ b/src/functions/public/Webhooks/Get-GitHubAppWebhookConfiguration.ps1 @@ -11,7 +11,9 @@ to access this endpoint. .EXAMPLE + ```powershell Get-GitHubAppWebhookConfiguration + ``` Returns the webhook configuration for the authenticated app. diff --git a/src/functions/public/Webhooks/Get-GitHubAppWebhookDelivery.ps1 b/src/functions/public/Webhooks/Get-GitHubAppWebhookDelivery.ps1 index 70c3a049e..40cf9244d 100644 --- a/src/functions/public/Webhooks/Get-GitHubAppWebhookDelivery.ps1 +++ b/src/functions/public/Webhooks/Get-GitHubAppWebhookDelivery.ps1 @@ -10,12 +10,16 @@ to access this endpoint. .EXAMPLE + ```powershell Get-GitHubAppWebhookDelivery + ``` Returns a list of webhook deliveries for the webhook for the authenticated app. .EXAMPLE + ```powershell Get-GitHubAppWebhookDelivery -ID 123456 + ``` Returns the webhook delivery with the ID `123456` for the authenticated app. diff --git a/src/functions/public/Webhooks/Invoke-GitHubAppWebhookReDelivery.ps1 b/src/functions/public/Webhooks/Invoke-GitHubAppWebhookReDelivery.ps1 index c1a649b3a..3866df748 100644 --- a/src/functions/public/Webhooks/Invoke-GitHubAppWebhookReDelivery.ps1 +++ b/src/functions/public/Webhooks/Invoke-GitHubAppWebhookReDelivery.ps1 @@ -10,7 +10,9 @@ to access this endpoint. .EXAMPLE + ```powershell Invoke-GitHubAppWebhookReDelivery -ID 12345 + ``` Redelivers the delivery with the ID `12345`. diff --git a/src/functions/public/Webhooks/Test-GitHubWebhookSignature.ps1 b/src/functions/public/Webhooks/Test-GitHubWebhookSignature.ps1 index a7e53b49a..e0f78da55 100644 --- a/src/functions/public/Webhooks/Test-GitHubWebhookSignature.ps1 +++ b/src/functions/public/Webhooks/Test-GitHubWebhookSignature.ps1 @@ -10,7 +10,9 @@ timing attacks. The function returns a boolean indicating whether the signature is valid. .EXAMPLE + ```powershell Test-GitHubWebhookSignature -Secret $env:WEBHOOK_SECRET -Body $Request.RawBody -Signature $Request.Headers['X-Hub-Signature-256'] + ``` Output: ```powershell @@ -20,7 +22,9 @@ Validates the provided webhook payload against the HMAC SHA-256 signature using the given secret. .EXAMPLE + ```powershell Test-GitHubWebhookSignature -Secret $env:WEBHOOK_SECRET -Request $Request + ``` Output: ```powershell diff --git a/src/functions/public/Webhooks/Update-GitHubAppWebhookConfiguration.ps1 b/src/functions/public/Webhooks/Update-GitHubAppWebhookConfiguration.ps1 index 1560ada7c..ee6b69336 100644 --- a/src/functions/public/Webhooks/Update-GitHubAppWebhookConfiguration.ps1 +++ b/src/functions/public/Webhooks/Update-GitHubAppWebhookConfiguration.ps1 @@ -11,7 +11,9 @@ to access this endpoint. .EXAMPLE + ```powershell Update-GitHubAppWebhookConfiguration -URL 'https://example.com' -ContentType 'json' -Secret 'mysecret' -EnableSsl + ``` Output: ```powershell diff --git a/src/functions/public/Workflows/Disable-GitHubWorkflow.ps1 b/src/functions/public/Workflows/Disable-GitHubWorkflow.ps1 index 8e7cf2661..040394953 100644 --- a/src/functions/public/Workflows/Disable-GitHubWorkflow.ps1 +++ b/src/functions/public/Workflows/Disable-GitHubWorkflow.ps1 @@ -8,6 +8,8 @@ For example, you could use `main.yaml`. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell + ``` .INPUTS GitHubWorkflow diff --git a/src/functions/public/Workflows/Enable-GitHubWorkflow.ps1 b/src/functions/public/Workflows/Enable-GitHubWorkflow.ps1 index 49d9b4c41..9eb9caedd 100644 --- a/src/functions/public/Workflows/Enable-GitHubWorkflow.ps1 +++ b/src/functions/public/Workflows/Enable-GitHubWorkflow.ps1 @@ -1,10 +1,27 @@ filter Enable-GitHubWorkflow { <# .SYNOPSIS + Enable a workflow .DESCRIPTION + Enables a workflow and sets the `state` of the workflow to `active`. You can use workflow + filename and ID in the `ID` parameter. For example, you could use `main.yaml`. + + OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. .EXAMPLE + ```powershell + Enable-GitHubWorkflow -Owner 'PSModule' -Repository 'GitHub' -ID 'main.yaml' + ``` + + Enables the workflow with the filename 'main.yaml' in the PSModule/GitHub repository. + + .EXAMPLE + ```powershell + Enable-GitHubWorkflow -Owner 'PSModule' -Repository 'GitHub' -ID 161335 + ``` + + Enables the workflow with the ID 161335 in the PSModule/GitHub repository. .INPUTS GitHubWorkflow diff --git a/src/functions/public/Workflows/Get-GitHubWorkflow.ps1 b/src/functions/public/Workflows/Get-GitHubWorkflow.ps1 index d9a4ba822..eac6c217b 100644 --- a/src/functions/public/Workflows/Get-GitHubWorkflow.ps1 +++ b/src/functions/public/Workflows/Get-GitHubWorkflow.ps1 @@ -9,12 +9,16 @@ GitHub Apps must have the actions:read permission to use this endpoint. .EXAMPLE + ```powershell Get-GitHubWorkflow -Owner 'octocat' -Repository 'hello-world' + ``` Gets all workflows in the 'octocat/hello-world' repository. .EXAMPLE + ```powershell Get-GitHubWorkflow -Owner 'octocat' -Repository 'hello-world' -Name 'hello-world.yml' + ``` Gets the 'hello-world.yml' workflow in the 'octocat/hello-world' repository. diff --git a/src/functions/public/Workflows/Runs/Get-GitHubWorkflowRun.ps1 b/src/functions/public/Workflows/Runs/Get-GitHubWorkflowRun.ps1 index 60292b63f..aa969ee54 100644 --- a/src/functions/public/Workflows/Runs/Get-GitHubWorkflowRun.ps1 +++ b/src/functions/public/Workflows/Runs/Get-GitHubWorkflowRun.ps1 @@ -12,22 +12,30 @@ `event`, `head_sha`, `status`. .EXAMPLE + ```powershell Get-GitHubWorkflowRun -Owner 'owner' -Repository 'repo' + ``` Lists all workflow runs for a repository. .EXAMPLE + ```powershell Get-GitHubWorkflowRun -Owner 'owner' -Repository 'repo' -Actor 'octocat' -Branch 'main' -Event 'push' -Status 'success' + ``` Lists all workflow runs for a repository with the specified actor, branch, event, and status. .EXAMPLE + ```powershell Get-GitHubWorkflowRun -Owner 'octocat' -Repository 'Hello-World' -ID '42' + ``` Gets all workflow runs for the workflow with the ID `42` in the repository `Hello-World` owned by `octocat`. .EXAMPLE + ```powershell Get-GitHubWorkflowRun -Owner 'octocat' -Repository 'Hello-World' -Name 'nightly.yml' -Actor 'octocat' -Branch 'main' -Event 'push' -Status 'success' + ``` Gets all workflow runs for the workflow with the name `nightly.yml` in the repository `Hello-World` owned by `octocat` that were triggered by the user `octocat` on the branch `main` and have the status `success`. diff --git a/src/functions/public/Workflows/Runs/Remove-GitHubWorkflowRun.ps1 b/src/functions/public/Workflows/Runs/Remove-GitHubWorkflowRun.ps1 index cd92f4a61..1be51bea9 100644 --- a/src/functions/public/Workflows/Runs/Remove-GitHubWorkflowRun.ps1 +++ b/src/functions/public/Workflows/Runs/Remove-GitHubWorkflowRun.ps1 @@ -1,4 +1,4 @@ -filter Remove-GitHubWorkflowRun { +filter Remove-GitHubWorkflowRun { <# .SYNOPSIS Delete a workflow run @@ -9,7 +9,9 @@ filter Remove-GitHubWorkflowRun { this endpoint. .EXAMPLE + ```powershell Remove-GitHubWorkflowRun -Owner 'octocat' -Repository 'Hello-World' -ID 123456789 + ``` Deletes the workflow run with the ID 123456789 from the 'Hello-World' repository owned by 'octocat' diff --git a/src/functions/public/Workflows/Runs/Restart-GitHubWorkflowRun.ps1 b/src/functions/public/Workflows/Runs/Restart-GitHubWorkflowRun.ps1 index 4011fca79..766371fab 100644 --- a/src/functions/public/Workflows/Runs/Restart-GitHubWorkflowRun.ps1 +++ b/src/functions/public/Workflows/Runs/Restart-GitHubWorkflowRun.ps1 @@ -7,7 +7,9 @@ Re-runs your workflow run using its `run_id`. You can also specify a branch or tag name to re-run a workflow run from a branch .EXAMPLE + ```powershell Start-GitHubWorkflowReRun -Owner 'octocat' -Repository 'Hello-World' -ID 123456789 + ``` .INPUTS GitHubWorkflowRun diff --git a/src/functions/public/Workflows/Runs/Stop-GitHubWorkflowRun.ps1 b/src/functions/public/Workflows/Runs/Stop-GitHubWorkflowRun.ps1 index c166b7573..ccf8b5965 100644 --- a/src/functions/public/Workflows/Runs/Stop-GitHubWorkflowRun.ps1 +++ b/src/functions/public/Workflows/Runs/Stop-GitHubWorkflowRun.ps1 @@ -7,7 +7,9 @@ Cancels a workflow run using its `run_id`. You can use this endpoint to cancel a workflow run that is in progress or waiting .EXAMPLE + ```powershell Stop-GitHubWorkflowRun -Owner 'octocat' -Repository 'Hello-World' -ID 123456789 + ``` Cancels the workflow run with the ID 123456789 from the 'Hello-World' repository owned by 'octocat'. diff --git a/src/functions/public/Workflows/Start-GitHubWorkflow.ps1 b/src/functions/public/Workflows/Start-GitHubWorkflow.ps1 index 3a651b57e..59d8fe9b3 100644 --- a/src/functions/public/Workflows/Start-GitHubWorkflow.ps1 +++ b/src/functions/public/Workflows/Start-GitHubWorkflow.ps1 @@ -7,12 +7,14 @@ Start a workflow run using the workflow's ID. .EXAMPLE + ```powershell Get-GitHubWorkflow | Where-Object name -NotLike '.*' | Start-GitHubWorkflow -Inputs @{ staticValidation = $true deploymentValidation = $false removeDeployment = $true prerelease = $false } + ``` .LINK https://psmodule.io/GitHub/Functions/Workflows/Start-GitHubWorkflow/ diff --git a/tools/utilities/New-Function.ps1 b/tools/utilities/New-Function.ps1 index 8c1955e05..088c628a3 100644 --- a/tools/utilities/New-Function.ps1 +++ b/tools/utilities/New-Function.ps1 @@ -6,13 +6,11 @@ .DESCRIPTION Long description - .PARAMETER Path - Parameter description - - .PARAMETER Method - Parameter description - .EXAMPLE + ```powershell + New-Function -Path '/user/emails' -Method 'POST' + ``` + An example .NOTES @@ -20,9 +18,11 @@ #> [CmdletBinding(SupportsShouldProcess)] param( + # Parameter description [Parameter(Mandatory)] [string] $Path, + # Parameter description [Parameter(Mandatory)] [string] $Method ) @@ -35,7 +35,7 @@ $response.paths.$Path.$Method - $FunctionName = "$Method-GitHub" + (($response.paths.$path.$method.operationId) -Replace '/', '-') + $FunctionName = "$Method-GitHub" + (($response.paths.$path.$method.operationId) -replace '/', '-') $folderName = $response.paths.$path.$method.'x-github'.category $subFolderName = $response.paths.$path.$method.'x-github'.subcategory diff --git a/tools/utilities/New-FunctionTemplate.ps1 b/tools/utilities/New-FunctionTemplate.ps1 index af7bcd7cc..c013af5d0 100644 --- a/tools/utilities/New-FunctionTemplate.ps1 +++ b/tools/utilities/New-FunctionTemplate.ps1 @@ -7,7 +7,9 @@ Long description .EXAMPLE + ```powershell An example + ``` .NOTES [Ttle](link)