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

run application asynchronously using powershell

$
0
0

Hello all,

I am trying to run an application asynchronously per each subfolder within a given directory, but I have not been able to create a script that behaves exactly as I want...

This is what I have so far:

$dir = dir C:\test | ?{$_.PSISContainer}

foreach ($d in $dir){
start-job -scriptblock {C:\test.exe /b $d.fullname}
}

Can you give me a hand to make it work and let me know why the $d.fullname is not being resolved by the full folder path?

note: $d.fullname is being resolved if for example i use "echo"

Many thanks in advance.


Viewing all articles
Browse latest Browse all 15028

Trending Articles