en-US/about_AzDoRepositorySettings.help.txt
|
.NAME
AzDoRepositorySettings .SYNOPSIS DSC resource for managing per-repository settings (singleton). .DESCRIPTION This resource manages repository-level settings in Azure DevOps Git repositories, including merge strategy restrictions and forking policies. These settings enforce consistent contribution workflows across teams. .PARAMETER ProjectName Key - System.String The name of the Azure DevOps project. This property is mandatory and serves as a key property for the resource. It cannot be changed after creation. .PARAMETER RepositoryName Required - System.String The name of the Git repository. This is a key property. It cannot be changed after creation. .PARAMETER DefaultBranch Write - System.String The default branch name for the repository. Defaults to main. .PARAMETER AllowSquashMerge Write - System.Boolean Whether squash merges are allowed for pull requests. Defaults to $true. .PARAMETER AllowRebaseMerge Write - System.Boolean Whether rebase merges are allowed for pull requests. Defaults to $true. .PARAMETER AllowNoFastForward Write - System.Boolean Whether regular (no-fast-forward) merges are allowed for pull requests. Defaults to $true. .PARAMETER DisableForking Write - System.Boolean Whether forking the repository is disabled. Defaults to $false. .EXAMPLE 1 This example shows how to configure repository settings in an Azure DevOps project. Configuration Example { Import-DscResource -ModuleName 'AzureDevOpsDscNative' node localhost { AzDoRepositorySettings 'AddAzDoRepositorySettings' { Ensure = 'Present' ProjectName = 'MyProject' RepositoryName = 'MyRepository' DefaultBranch = 'main' AllowSquashMerge = $true AllowRebaseMerge = $true AllowNoFastForward = $true DisableForking = $false } } } .EXAMPLE 2 This example shows how to update repository settings to restrict merge strategies. Configuration Example { Import-DscResource -ModuleName 'AzureDevOpsDscNative' node localhost { AzDoRepositorySettings 'UpdateAzDoRepositorySettings' { Ensure = 'Present' ProjectName = 'MyProject' RepositoryName = 'MyRepository' DefaultBranch = 'main' AllowSquashMerge = $true AllowRebaseMerge = $false AllowNoFastForward = $false DisableForking = $true } } } .EXAMPLE 3 This example shows how to reset repository settings to defaults in an Azure DevOps project. Configuration Example { Import-DscResource -ModuleName 'AzureDevOpsDscNative' node localhost { AzDoRepositorySettings 'RemoveAzDoRepositorySettings' { Ensure = 'Absent' ProjectName = 'MyProject' RepositoryName = 'MyRepository' } } } |