parameters:
  - name: DailyBranchVariableName
    type: string
    default: TargetBranchName

steps:
  - pwsh: |
      $branchName = $env:DAILYDOCSBRANCHNAMEOVERRIDE
      if (!$branchName) { 
        $branchName = "daily/$(Get-Date -Format 'yyyy-MM-dd')"
      }
      Write-Host "Daily Branch Name: $branchName"
      Write-Host "##vso[task.setvariable variable=${{ parameters.DailyBranchVariableName }};]$branchName"
    displayName: Set daily docs branch name in $(${{ parameters.DailyBranchVariableName }})
