I have a command line task running in windows image of Azure DevOps pipeline.
This task after performing pmd.bat command exiting with code 4. Where as this runs perfectly fine in my local CMD.

```
 task: CmdLine@2
  inputs:
   script:  |
       echo starting  execution
       cd $(Build.SourcesDirectory)
       xcopy *.jar $(Build.SourcesDirectory)\code\
       cd $(Build.SourcesDirectory)\pmd-bin-6.24.0\bin
       pmd.bat -d "$(Build.SourcesDirectory)\code\src\apexcode.cls" -f xml -R "$(Build.SourcesDirectory)\code\build\MyApexRule.xml" -reportfile pmd.xml

```

Can anyone help me with what can be the issue?