Advertisement
Guest User

Untitled

a guest
Sep 15th, 2022
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $x = "yeah"
  2.  
  3. $sb = {
  4.   param($n)
  5.   '{0}: {1}' -f $n, $using:x
  6.   $y = 'foo'
  7.   Invoke-Command -ComputerName PC  -ScriptBlock { 'invoke2: {0}' -f $using:y }
  8. }
  9.  
  10. Start-Job -ScriptBlock $sb -ArgumentList 'job' | Receive-Job -Wait -AutoRemoveJob
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement