Environment approvals work per-stage. Split your jobs into separate stages:
- stage: development
condition: contains(variables['Build.SourceBranch'], 'refs/heads/develop')
- deployment: Deploy_Dev
displayName: 'Deploy Develop to Dev Machine'
I'm not familiar with Invoke-Build, but appearantly it's a part of the InvokeBuild PowerShell module? In that case, you'll have to install the module as part of the script where you're using it. Your YAML should be something like this:
- stage: Build
- job: Build
- task: PowerShell@2
If your after the branch name, and your branches don't include "directories" (example: releases/my_release), then Build.SourceBranchName will you give you "The last path segment in the ref". So, if Build.SourceBranch is refs/heads/master, then Build.SourceBranch will be master.