< Back

Get-BranchPolicy

Sat Jan 11, 2020 10:30 am

NAME Get-BranchPolicy



SYNOPSIS

Gets the Branch Policies for the given Team Project, RepositoryName and RefName (branch)





SYNTAX

Get-BranchPolicy [-ProjectName] <String> [-RepositoryName] <String> [-RefName] <String> [<CommonParameters>]





DESCRIPTION

Fetches all of the policies that are found on the 'Policies' page of a given Azure DevOps Git Branch.



This Module relies on VsTeam so you must call Set-VsTeamAccount.





PARAMETERS

-ProjectName <String>

Name of the Team Project. ie: bootstrapping



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RepositoryName <String>

Name of the Repository. If your Team Project has only a single repository, this is usually the same as the

ProjectName.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RefName <String>

The branch/ref whose policies you wish to retrieve. ie: for master: refs/heads/master.



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Collections.Hashtable





-------------------------- EXAMPLE 1 --------------------------



C:\\PS>Set-VSTeamAccount -Account "YOURVSTSACCOUNT" -PersonalAccessToken "YOURPAT"



C:\\PS> Get-BranchPolicy -ProjectName bootstrapping -RepositoryName vue-js -RefName "refs/heads/master"

Name Value

---- -----

CheckForCommentResolutionPo... {Blocking, Enabled}

RequiredReviewersPolicy {Policies}

ProjectName bootstrapping

RequireAMergeStrategyPolicy {AllowRebase, AllowNoFastForward, AllowRebaseMerge, AllowSquash...}

MinimumReviewersPolicy {ResetOnSourcePush, AllowDownvotes, CreatorViewCounts, MinimumApproverCount...}

StatusPolicy {Policies}

RepositoryName RepositoryName

CheckForLinkedWorkItemsPolicy {Blocking, Enabled}

RefName refs/heads/master

BuildValidationPolicy {Policies}











RELATED LINKS