Holen Sie sich den Namen Azure Pipeline Branch
$branchSource = "$(Build.SourceBranch)" #this is "refs/heads/YourBranch"
$branchSourcePath = $branchSource -replace "refs/heads/", "" #this is "YourBranch"
Clément Bazin