title: How to return PowerShell variable to VBScript
body: <p>I have a vbscript to call a PowerShell script in hopes of returning the PowerShell output to an HTA (HTML Application) GUI. Right now I just want to see if I can return the PowerShell output into a MsgBox in the vbscript. I am not having much luck with this.</p>
  
  <p>VBScript Code: </p>
  
  <pre><code>Set shell = CreateObject("WScript.Shell")
  return = shell.Run("powershell.exe -executionpolicy bypass -noprofile -file pathToScript\PowerShellToVBA.ps1", , true)
  MsgBox return
  </code></pre>
  
  <p>PowerShell Code: </p>
  
  <pre><code>Clear-Host
  return 50
  </code></pre>
  
  <p>I am trying to keep the return value extremely simple until it works. With this,  I would expect the MsgBox to return '50', however it is returning '0' instead. Any ideas what im doing wrong?</p>