Skip to main content
Version: 2.2.1-preview

Test-AzdoOrganizationSecretProtectionPushProtection

SYNOPSIS

Returns a boolean depending on the configuration.

SYNTAX

Test-AzdoOrganizationSecretProtectionPushProtection [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Checks if every Git repository with the GitHub Secret Protection plan enabled also blocks pushes that contain secrets.

'Push protections' is the optional Secret Protection feature found under Options for the Secret Protection plan. 'Secret alerts' is always available and cannot be turned off, so it is not assessed.

The blockPushes property is only returned when the org enablement API is called with includeAllProperties=true, and only api-version 7.2-preview.3 returns the per-plan feature set, so this test calls the endpoint directly instead of using Get-ADOPSOrganizationAdvancedSecurity.

Requires membership of the 'Project Collection Administrators' group or the 'Advanced Security: manage settings' permission set to Allow.

https://learn.microsoft.com/azure/devops/repos/security/configure-github-advanced-security-features?view=azure-devops#set-up-secret-scanning

EXAMPLES

EXAMPLE 1

Test-AzdoOrganizationSecretProtectionPushProtection

Returns a boolean depending on the configuration.

PARAMETERS

-ProgressAction

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Boolean

NOTES

https://maester.dev/docs/commands/Test-AzdoOrganizationSecretProtectionPushProtection