Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How to use function inside background job?

$
0
0

I try to call function inside job. It does not work. Is it possible to use function inside job or not. I hope you can help me. Here is my example code.

Start-Job -Name ForestJob {param($v01,$v02)

  $line = @()

  function test {
    return "testvalue"
  }

  $t = test
  $line += $t

} -ArgumentList $var01, $var02


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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