New-GitHubActionsHostedRunnerForOrg
SYNOPSIS
Create a GitHub-hosted runner for an organization
SYNTAX
Default (Default)
New-GitHubActionsHostedRunnerForOrg [-Org] <string> -Name <string> -Image <Object> -Size <string>
-RunnerGroupId <long> [-MaximumRunners <long>] [-EnableStaticIp] [-ImageGen] [-Accept <string>]
[-WhatIf] [-Confirm]
Body
New-GitHubActionsHostedRunnerForOrg [-Org] <string> -Body <Object> [-Name <string>]
[-Image <Object>] [-Size <string>] [-RunnerGroupId <long>] [-MaximumRunners <long>]
[-EnableStaticIp] [-ImageGen] [-Accept <string>] [-WhatIf] [-Confirm]
ALIASES
This cmdlet has the following aliases,
- Get-GHNewActionsHostedRunnerForOrg
DESCRIPTION
The New-GitHubActionsHostedRunnerForOrg cmdlet invokes the POST method of the /orgs/{org}/actions/hosted-runners endpoint (Create a GitHub-hosted runner for an organization)
Creates a GitHub-hosted runner for an organization. OAuth tokens and personal access tokens (classic) need the ‘manage_runners:org’ scope to use this endpoint.
Endpoint: POST /orgs/{org}/actions/hosted-runners API version: 2026-03-10
EXAMPLES
EXAMPLE 1
New-GitHubActionsHostedRunnerForOrg -Org 'github' -Name 'My Hosted runner' -Image @{ key = 'value' } -Size '4-core' -RunnerGroupId 1 -Body @{ key = 'value' }
Invokes POST /orgs/{org}/actions/hosted-runners
EXAMPLE 2
New-GitHubActionsHostedRunnerForOrg -Org 'github' -Body @{ name = 'My Hosted runner' }
Sends the request body from a hashtable, parameters override the keys of -Body
PARAMETERS
-Accept
The Accept header (media type) of the request Default value: application/vnd.github+json
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Body
The whole request body as a hashtable or object. Keys that are also available as parameters are overwritten by the parameter values
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-EnableStaticIp
Whether this runner should be created with a static public IP. Note limit on account. To list limits on account, use ‘GET actions/hosted-runners/limits’
Body property [ enable_static_ip ]
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Image
The image of runner. To list all available images, use ‘GET /actions/hosted-runners/images/github-owned’ or ‘GET /actions/hosted-runners/images/partner’.
Required unless -Body is used
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: Default
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-ImageGen
Whether this runner should be used to generate custom images.
Body property [ image_gen ]
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-MaximumRunners
The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost.
Body property [ maximum_runners ]
Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Name
Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, ‘.’, ‘-‘, and ‘_’.
Required unless -Body is used
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: Default
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Org
The organization name. The name is not case sensitive.
Path parameter [ org ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-RunnerGroupId
The existing runner group to add this runner to.
Required unless -Body is used
Body property [ runner_group_id ]
Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: Default
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Size
The machine size of the runner. To list available sizes, use ‘GET actions/hosted-runners/machine-sizes’
Required unless -Body is used
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: Default
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-WhatIf
Runs the command in a mode that only reports what would happen without performing the actions.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
Objects with properties named like the path parameters can be piped to this function
{{ Fill in the Description }}
System.String
{{ Fill in the Description }}
OUTPUTS
The response of the GitHub API (objects
{{ Fill in the Description }}
NOTES
OperationId: actions/create-hosted-runner-for-org Category: actions / hosted-runners