start-job

Start-job vs. Invoke-command -asjob

I'm trying to do basic background jobs in PowerShell 2.0, and I'm seeing different things with start-job and invoke-command -asjob. If I do this: start-job -scriptblock {get-process} I get a job object, but the child job (which is created automatically by start-job) always has a JobStateInfo of "NotStarted". this, however, works as e...

PowerShell Start-Job Working Directory

Is there a way to specify a working directory to the Start-Job command? Use-case: I'm in a directory, and I want to open a file using Emacs for editing. If I do this directly, it will block PowerShell until I close Emacs. But using Start-Job attempts to run Emacs from my home directory, thus having Emacs open a new file instead of the ...

PSExec never completes when run inside start-job

I'm trying to execute a cmd file on a list of 48 computers. I don't want to execute and wait for completion sequentially because each cmd takes about 10 minutes to complete. WinRM isn't an option. Neither is WMI. PSExec is an option....but I can't seem to make it work inside of Start-Job. I'm doing something like: $sb = { param...

Powershell Start-Job won't run

I'm trying to run a simple job process in powershell 2.0 and it doesn't seem to run. $job = Start-Job { Return "Some string." } When I call $job, the status says it's running. But the problem is that it never completes. Tried the same thing on my Windows 7 machine and it completes immediately. I'm running powershell 2.0 on wind...