en-US/about_AzDoBranchPolicy.help.txt

.NAME
    AzDoBranchPolicy
 
.SYNOPSIS
    DSC resource for managing Azure DevOps branch policies.
 
.DESCRIPTION
    The AzDoBranchPolicy class manages branch policy configurations on a Git
    repository branch within an Azure DevOps project.
 
.PARAMETER ProjectName
    Key - System.String
    The Azure DevOps project name.
 
.PARAMETER RepositoryName
    Required - System.String
    The Git repository name.
 
.PARAMETER BranchName
    Required - System.String
    The branch ref name (e.g. 'refs/heads/main').
 
.PARAMETER PolicyType
    Required - System.String
    The policy type display name (e.g. 'MinimumReviewerCount').
 
.PARAMETER isEnabled
    Write - System.Boolean
    Whether the policy is enabled. Default is $true.
 
.PARAMETER isBlocking
    Write - System.Boolean
    Whether the policy is blocking. Default is $true.
 
.PARAMETER PolicySettings
    Write - HashTable
    Policy-type-specific settings hashtable.
 
.EXAMPLE 1
 
This example shows how to ensure that a minimum reviewer count branch policy
exists on the 'main' branch of the 'MyRepository' repository.
 
Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'
 
    node localhost
    {
        AzDoBranchPolicy 'AddBranchPolicy'
        {
            Ensure = 'Present'
            ProjectName = 'MyProject'
            RepositoryName = 'MyRepository'
            BranchName = 'refs/heads/main'
            PolicyType = 'MinimumReviewerCount'
            isEnabled = $true
            isBlocking = $true
            PolicySettings = @{
                minimumApproverCount = 2
                creatorVoteCounts = $false
            }
        }
    }
}
 
.EXAMPLE 2
 
This example shows how to update an existing branch policy, changing the
minimum reviewer count and making it non-blocking.
 
Configuration Example
{
    Import-DscResource -ModuleName 'AzureDevOpsDscNative'
 
    node localhost
    {
        AzDoBranchPolicy 'UpdateBranchPolicy'
        {
            Ensure = 'Present'
            ProjectName = 'MyProject'
            RepositoryName = 'MyRepository'
            BranchName = 'refs/heads/main'
            PolicyType = 'MinimumReviewerCount'
            isEnabled = $true
            isBlocking = $false
            PolicySettings = @{
                minimumApproverCount = 1
                creatorVoteCounts = $true
            }
        }
    }
}