Ranadip_Dutta

Start-Job /Passing Value Inside Script Block

Oct 23rd, 2016
2,492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ini='$var="'+$args[0]+'"'
  2. $a={
  3.  Function Get-add()
  4.         {
  5.         "this  is the value of $var"
  6.  
  7.         }
  8.  }
  9. start-job -InitializationScript $a -ScriptBlock {param($ini)iex $ini;get-add } -ArgumentList $ini |Wait-Job | Receive-Job
Add Comment
Please, Sign In to add comment