Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

start-job scriptblock

$
0
0

Hi,

I am trying to use start-job with a scriptblock while passing args.  The start-job runs, but the exe never starts on my local machine.  I can't figure out why it will not start.   Calling with -filepath works.   Although, when I do that I call it differently.  I use a ps1 script to invoke the exe.   I haven't been able to call this while stating a scriptblock.  Although filepath turns everything after into a scriptblock.

$sb = {'C:\Program Files\app\Cache.exe $args[0]'} 

start-job -scriptblock $sb -argumentlist "/arg /item1=arg /item2=arg /item3=arg" -name CCC 

Just for comparision, my ps1 script

$app = "C:\Program Files\app\Cache.exe",
$aargs = "/arg /item1=arg /item2=arg /item3=arg

start-Process $app -PassThru $aargs -wait




Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>