Вы можете использовать Gradle Exec
Пример:
task execPs(type:Exec) {
commandLine 'cmd', '/c', 'Powershell -File sample.ps1'
}
// add this task to your build.gradle file and execute gradle execPs
// You can use a different name for this task
// You can add a dependency to include this task as part of your normal build. (like below)
// build.finalizedBy(execPs)
// with the above command gradle build will call your task at the end of build