New-GitHubCodeSecurityConfigurationForEnterprise
SYNOPSIS
Create a code security configuration for an enterprise
SYNTAX
Default (Default)
New-GitHubCodeSecurityConfigurationForEnterprise [-Enterprise] <string> -Name <string>
[-Description <string>] [-AdvancedSecurity <string>] [-CodeSecurity <string>]
[-DependencyGraph <string>] [-DependencyGraphAutosubmitAction <string>]
[-DependencyGraphAutosubmitActionOptions <Object>] [-DependabotAlerts <string>]
[-DependabotReachability <string>] [-DependabotSecurityUpdates <string>]
[-CodeScanningOptions <Object>] [-CodeScanningDefaultSetup <string>]
[-CodeScanningDefaultSetupOptions <Object>] [-CodeScanningDelegatedAlertDismissal <string>]
[-SecretProtection <string>] [-SecretScanning <string>] [-SecretScanningPushProtection <string>]
[-SecretScanningValidityChecks <string>] [-SecretScanningNonProviderPatterns <string>]
[-SecretScanningGenericSecrets <string>] [-SecretScanningGenericSecretsPushProtection <string>]
[-SecretScanningDelegatedAlertDismissal <string>] [-SecretScanningExtendedMetadata <string>]
[-PrivateVulnerabilityReporting <string>] [-Enforcement <string>] [-Accept <string>] [-WhatIf]
[-Confirm]
Body
New-GitHubCodeSecurityConfigurationForEnterprise [-Enterprise] <string> -Body <Object>
[-Name <string>] [-Description <string>] [-AdvancedSecurity <string>] [-CodeSecurity <string>]
[-DependencyGraph <string>] [-DependencyGraphAutosubmitAction <string>]
[-DependencyGraphAutosubmitActionOptions <Object>] [-DependabotAlerts <string>]
[-DependabotReachability <string>] [-DependabotSecurityUpdates <string>]
[-CodeScanningOptions <Object>] [-CodeScanningDefaultSetup <string>]
[-CodeScanningDefaultSetupOptions <Object>] [-CodeScanningDelegatedAlertDismissal <string>]
[-SecretProtection <string>] [-SecretScanning <string>] [-SecretScanningPushProtection <string>]
[-SecretScanningValidityChecks <string>] [-SecretScanningNonProviderPatterns <string>]
[-SecretScanningGenericSecrets <string>] [-SecretScanningGenericSecretsPushProtection <string>]
[-SecretScanningDelegatedAlertDismissal <string>] [-SecretScanningExtendedMetadata <string>]
[-PrivateVulnerabilityReporting <string>] [-Enforcement <string>] [-Accept <string>] [-WhatIf]
[-Confirm]
ALIASES
This cmdlet has the following aliases,
- Get-GHNewCodeSecurityConfigurationForEnterprise
DESCRIPTION
The New-GitHubCodeSecurityConfigurationForEnterprise cmdlet invokes the POST method of the /enterprises/{enterprise}/code-security/configurations endpoint (Create a code security configuration for an enterprise)
Creates a code security configuration in an enterprise.
The authenticated user must be an administrator of the enterprise in order to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the ‘admin:enterprise’ scope to use this endpoint.
Endpoint: POST /enterprises/{enterprise}/code-security/configurations API version: 2026-03-10
EXAMPLES
EXAMPLE 1
' -Name 'High rish settings' -Body @{ key = 'value' }
Invokes POST /enterprises/{enterprise}/code-security/configurations
EXAMPLE 2
' -Body @{ name = 'High rish settings' }
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: ''
-AdvancedSecurity
The enablement status of GitHub Advanced Security features. ‘enabled’ will enable both Code Security and Secret Protection features. [!WARNING] ‘code_security’ and ‘secret_protection’ are deprecated values for this field. Prefer the individual ‘code_security’ and ‘secret_protection’ fields to set the status of these features.
Body property [ advanced_security ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘code_security’, ‘secret_protection’
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: ''
-CodeScanningDefaultSetup
The enablement status of code scanning default setup
Body property [ code_scanning_default_setup ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-CodeScanningDefaultSetupOptions
Feature options for code scanning default setup
Body property [ code_scanning_default_setup_options ]
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-CodeScanningDelegatedAlertDismissal
The enablement status of code scanning delegated alert dismissal
Body property [ code_scanning_delegated_alert_dismissal ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-CodeScanningOptions
Security Configuration feature options for code scanning
Body property [ code_scanning_options ]
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-CodeSecurity
The enablement status of GitHub Code Security features.
Body property [ code_security ]
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
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: ''
-DependabotAlerts
The enablement status of Dependabot alerts
Body property [ dependabot_alerts ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-DependabotReachability
The enablement status of reachability analysis for Dependabot. Only available for enterprises with access to reachability analysis. Requires Dependabot alerts to be enabled when set to ‘enabled’. Must be ‘disabled’ when Dependabot alerts is ‘disabled’. ‘not_set’ leaves existing repository settings unchanged.
Body property [ dependabot_reachability ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-DependabotSecurityUpdates
The enablement status of Dependabot security updates
Body property [ dependabot_security_updates ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-DependencyGraph
The enablement status of Dependency Graph
Body property [ dependency_graph ]
Default value: enabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-DependencyGraphAutosubmitAction
The enablement status of Automatic dependency submission
Body property [ dependency_graph_autosubmit_action ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-DependencyGraphAutosubmitActionOptions
Feature options for Automatic dependency submission
Body property [ dependency_graph_autosubmit_action_options ]
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Description
A description of the code security configuration
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Enforcement
The enforcement status for a security configuration
Default value: enforced
Allowed values: ‘enforced’, ‘unenforced’, ‘enterprise_enforced’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Enterprise
The slug version of the enterprise name.
Path parameter [ enterprise ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Name
The name of the code security configuration. Must be unique within the enterprise.
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: ''
-PrivateVulnerabilityReporting
The enablement status of private vulnerability reporting
Body property [ private_vulnerability_reporting ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SecretProtection
The enablement status of GitHub Secret Protection features.
Body property [ secret_protection ]
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SecretScanning
The enablement status of secret scanning
Body property [ secret_scanning ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SecretScanningDelegatedAlertDismissal
The enablement status of secret scanning delegated alert dismissal
Body property [ secret_scanning_delegated_alert_dismissal ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SecretScanningExtendedMetadata
The enablement status of secret scanning extended metadata
Body property [ secret_scanning_extended_metadata ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SecretScanningGenericSecrets
The enablement status of Copilot secret scanning
Body property [ secret_scanning_generic_secrets ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SecretScanningGenericSecretsPushProtection
The enablement status of generic secrets push protection
Body property [ secret_scanning_generic_secrets_push_protection ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SecretScanningNonProviderPatterns
The enablement status of secret scanning non provider patterns
Body property [ secret_scanning_non_provider_patterns ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SecretScanningPushProtection
The enablement status of secret scanning push protection
Body property [ secret_scanning_push_protection ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-SecretScanningValidityChecks
The enablement status of secret scanning validity checks
Body property [ secret_scanning_validity_checks ]
Default value: disabled
Allowed values: ‘enabled’, ‘disabled’, ‘not_set’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
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: code-security/create-configuration-for-enterprise Category: code-security / configurations Not enabled for GitHub Apps