title: Passing variable by reference from Inno Setup to PowerShell script to retrieve a result
body: <p>I am trying to pass <code>error</code> and <code>error_msg</code> variables to PowerShell script by reference. But it is not working. It is not reflecting changes done inside the <code>checkHost.ps1</code>.</p>
  
  <pre class="lang-pascal prettyprint-override"><code>var
    error_msg: String;
    error: String;
    ok: String;
  
  function NextButtonClick(CurPageID: Integer): Boolean;
  begin
    error_msg := 'all well';
    Result := True;
    error := 'false';
    ok := 'true';
  
    exec('powershell.exe',
      '-noexit -executionpolicy bypass ' +
      '"D:\Hyperv_ins_BM\checkHost.ps1 [ref]error   [ref]error_msg"',
      ExpandConstant('{tmp}'), SW_SHOW, ewWaitUntilTerminated, ResultCode);
  end; 
  </code></pre>
  
  <p>Can anybody help?</p>