Java – Jenkins command shows all files in a directory?

Jenkins command shows all files in a directory?… here is a solution to the problem.

Jenkins command shows all files in a directory?

I have created a workspace and cloned all the files into it. Now, I’m running my code through Jenkins. Can anyone assist with how to display all the files in my workspace with any command. I tried using ${workspace} dir in Jenkins but it shows no output.

Basically, if you are in any folder in your system and you open cmd in Windows and perform dir, it will show you all the files in it.
I’d like to see the same thing in Jenkins for Windows.

Thank you.

Solution

Only dir does not have ${workspace}

bat 'dir' in the pipeline script.

Select the Execute Batch Command option and write the command you want to execute there.

Then check the console output of a successful build.

Related Problems and Solutions