So far I used the below code for getting the commitHash in my JenkinsFile.groovy from linux slaves:
def commitHash = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
Now I'm running on windows slave. How can I modify this command to run on windows as well through CMD?