title: How to pass PowerShell variables from remote to local session
body: <p>Is there a way with PowerShell to pass multiple variables from a single Invoke-Command remote session back to the local session?</p>
  
  <p>Example (variables are not passed to local session here):</p>
  
  <pre><code>Invoke-Command -ComputerName Server1 -ScriptBlock {
  $a = "Variable 1"
  $b = "Variable 2"
  $c = "Variable 3"
  }
  
  Write-Output $a $b $c
  </code></pre>