0

Do you have some simple working example on how to run a powershell script file in a task inside YAML file. just like this one? Seems that mine is not able to pick up and execute the script since logs are not being printed.

- task: PowerShell@2
    displayName: task 1
    inputs:
      targetType: 'filePath'
      filePath: scripts\sample_pwsh.ps1
      arguments: -Name someName
rnstvrcstll
  • 71
  • 1
  • 7

1 Answers1

0
  • You are using the correct Syntax of PowerShell@2 Task. Try to confirm your filePath. filePath should be an absolute path from the root.
  • e.g.,filePath: root/complete/path/scripts/sample_pwsh.ps1
  • If this does not work, try checking your ps1 script.
owesom
  • 81
  • 4