Skip to main content
Version: 2.2.1-preview

Get-AzdoAdvancedSecurityEnablement

SYNOPSIS

Returns the Azure DevOps Advanced Security organization enablement state.

SYNTAX

Get-AzdoAdvancedSecurityEnablement [-Organization] <String> [-IncludeAllProperties]
[-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Calls the Advanced Security org enablement API at api-version 7.2-preview.3, which is the earliest version that reports the separate GitHub Secret Protection and GitHub Code Security plans. Get-ADOPSOrganizationAdvancedSecurity pins 7.2-preview.1, which returns only the bundled enableOnCreate and advSecEnabled values, so it cannot be used for the per-plan checks. See https://github.com/AZDOPS/AZDOPS/issues/266.

The request is not allowed to throw, because several checks share it and each needs to report the failure as a skipped test rather than an error. The returned object therefore carries either Enablement or RequestError, and the caller decides how to report it. Reporting is left to the caller so that Add-MtTestResultDetail resolves the companion markdown of the test that is running, not of this helper.

EXAMPLES

EXAMPLE 1

Get-AzdoAdvancedSecurityEnablement -Organization 'contoso'

Returns an object whose Enablement property holds the org enablement state, or whose RequestError property holds the terminating error if the call failed.

EXAMPLE 2

Get-AzdoAdvancedSecurityEnablement -Organization 'contoso' -IncludeAllProperties

Also requests the properties that are only returned on demand, such as per-repository blockPushes.

PARAMETERS

-Organization

The Azure DevOps organization to query.

Type: String
Parameter Sets: (All)
Aliases:

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

-IncludeAllProperties

Request the properties the API only returns when asked, currently per-repository blockPushes.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-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.Management.Automation.PSObject

NOTES