gulp-run icon indicating copy to clipboard operation
gulp-run copied to clipboard

Wait for powershell script to finish, callback not working?

Open evtk opened this issue 7 years ago • 2 comments

Hello,

Great plugin, thanks!. Maybe I'm trying something impossible here, but let's give it a go. I'm using gulp-run to start up a powershell script that executes in a separate powershell window. I thought I could use the callback function to be able to have gulp-run to finish the task, after the powershell script has done it's job.. but can 't get it to work. I'm loading powershell with the 'Start-Process' command.

function deploy(done) {
 // some variable definitly left out (argumentlist)
  return run('Start-Process powershell.exe -ArgumentList ' + argumentList, { usePowerShell: true }).exec(function () {
    done();
  });
}
gulp.task('deploy', deploy);

This is the output, you can see it doesn't wait for completion:

[16:40:18] Starting 'deploy'...                                                                                                                                                                                    
[16:40:18] Finished 'deploy' after 543 ms                                                                                                                                                                          
$ Start-Process powershell.exe -ArgumentList etc....

Any thoughts on this? Thanks!

evtk avatar Oct 17 '16 14:10 evtk

Let me know do you have any updates on this ?

hrishikeshtt avatar May 08 '18 12:05 hrishikeshtt

hi, sorry no updates to report.

evtk avatar May 14 '18 10:05 evtk