--rerunfailedtest with xunit file in Azure pipeline

Hi,

Is there a way to use a cmd or powershell command in the Azure build pipeline
Expected result of the command is:
rerun the failed testcases as a task (cmd or Powershell) in the Azure pipeline and merge the output files (xml) with initial outputxunit.xml and the output2 file.

See the example below.

Azure is using -x (xunit) to interpret the output

I use the following command

robot -x outputxunit TC*.robot | robot --rerunfailed outputxunit.xml -x output2.xml TC*.robot | rebot --output outputxunit.xml --merge outputxunit.xml output2.xml

the Error message is:
[ ERROR ] Reading XML source ‘outputxunit.xml’ failed: Incompatible root element ‘testsuite’.

Does anyone have an idea?

Thanks
Joost

I would try to not use pipe to rebot, but instead to use a real file.

like an input xml file?

Yes, instead of one command like you have with piping the input to rebot, you would redirect to a new xml file, and then in another command use it for rebot.