Azure Devops - Classic Pipeline - OWASP Zap Scanner Test - Powershell Task

722 Views Asked by At

Trying to Convert ZAP XML to NUnit XML in Azure Devops Release pipeline for OWASP ZAP Security testing, getting following error in Powershell Task. Please help

2021-09-06T09:39:32.4736044Z ##[section]Starting: Convert ZAP XML to NUnit XML
2021-09-06T09:39:32.4744197Z ==============================================================================
2021-09-06T09:39:32.4744531Z Task         : PowerShell
2021-09-06T09:39:32.4744804Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2021-09-06T09:39:32.4745074Z Version      : 2.190.0
2021-09-06T09:39:32.4745298Z Author       : Microsoft Corporation
2021-09-06T09:39:32.4745622Z Help         : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2021-09-06T09:39:32.4746679Z ==============================================================================
2021-09-06T09:39:32.6192068Z Generating script.
2021-09-06T09:39:32.6225079Z ========================== Starting Command Output ===========================
2021-09-06T09:39:32.6236523Z [command]/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/home/vsts/work/_temp/55afabcf-833e-4c93-8d60-c067a14be9ab.ps1'
2021-09-06T09:39:33.5525712Z [91mTransformOWASPReport: [0m/home/vsts/work/r1/a/_Testing/Transform.ps1:28
2021-09-06T09:39:33.5527142Z [96mLine |
2021-09-06T09:39:33.5529111Z [96m  28 | [0m … ransformOWASPReport -XLSTPath $XLSTPath -OWASPFile [96m$OWASPFile[0m -Transf …
2021-09-06T09:39:33.5530107Z [96m     | [91m                                                      ~~~~~~~~~~
2021-09-06T09:39:33.5531096Z [91m[96m     | [91mCannot bind argument to parameter 'OWASPFile' because it is an
2021-09-06T09:39:33.5531923Z [96m     | [91mempty string.
2021-09-06T09:39:33.5781242Z ##[error]PowerShell exited with code '1'.
2021-09-06T09:39:33.5816175Z ##[section]Finishing: Convert ZAP XML to NUnit XML
1

There are 1 best solutions below

2
On

The issue is resolved, we have given a correct path in PS variables.