Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $x = "yeah"
- $sb = {
- param($n)
- '{0}: {1}' -f $n, $using:x
- $y = 'foo'
- Invoke-Command -ComputerName PC -ScriptBlock { 'invoke2: {0}' -f $using:y }
- }
- Start-Job -ScriptBlock $sb -ArgumentList 'job' | Receive-Job -Wait -AutoRemoveJob
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement