There are built-in PowerShell/Bash tasks that you can add to your pipeline.
You can add .ps1 or .sh to your repository and in the task specify the script file, or put an inline script.
If you using .yaml builds you can add them in this way:
# PowerShell
# Run a PowerShell script on Windows, macOS, or Linux.
- task: PowerShell@2
inputs:
#targetType: 'filePath' # Optional. Options: filePath, inline
#filePath: # Required when targetType == FilePath
#arguments: # Optional
#script: '# Write your powershell commands here.' # Required when targetType == Inline
#errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue
#failOnStderr: false # Optional
#ignoreLASTEXITCODE: false # Optional
#pwsh: false # Optional
#workingDirectory: # Optional
# Bash
# Run a Bash script on macOS, Linux, or Windows
- task: Bash@3
inputs:
#targetType: 'filePath' # Optional. Options: filePath, inline
#filePath: # Required when targetType == FilePath
#arguments: # Optional
#script: '# Write your commands here# Use the environment variables input below to pass secret variables to this script' # Required when targetType == Inline
#workingDirectory: # Optional
#failOnStderr: false # Optional
#noProfile: true # Optional
#noRc: true # Optional
If you using the visual designer you can add the tasks in this way:

