steps.script purpose is NOT clear. It allows only Inline Scripts to be executed? I actually want to use file with steps.script instead of inline script.
Cannot i use CmdLine@2 on windows or Bash@3 on linux/Unix Instead of steps.script.
Link for steps.script: https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-script?view=azure-pipelines
Link for CmdLine@2: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/command-line?view=azure-devops&tabs=yaml
Link for Bash@3: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/bash?view=azure-devops
The Script step is a platform agnostic step in YAML:
You can also explicitly use
pwsh:
orpowershell:
orbash:
to explicitly pick a certain script type. These are convenience shortcuts for the respective tasks, this is from thePowerShell@2
docs:The same applies to the other YAML convenience shortcuts.
It's basically up to your preference which one you pick and whether you use the shortcut or the full step name.