title: Code works in CLR project but not Win32
body: <p>I am trying to run </p>
  
  <pre><code>std::string exec(const char* cmd) {
      std::shared_ptr&lt;FILE&gt; pipe(_popen(cmd, "r"), _pclose);
      if (!pipe) return "ERROR";
      char buffer[128];
      std::string result = "";
      while (!feof(pipe.get())) {
           if (fgets(buffer, 128, pipe.get()) != NULL)
              result += buffer;
      }
      return result;
  }
  
  string domainNameList = exec("powershell.exe -Command \"$computers = Get-WsusComputer -All; $computers | foreach-object{ Write-Output $_.FullDomainName; }\"");
  </code></pre>
  
  <p>It seems to work fine in my pure CLR application but when I try to do it in a Win32 Application.  I get a response saying that </p>
  
  <pre><code>foreach-object{ is not recognized as a batch command
  </code></pre>
  
  <p>I am not sure why the pipe is breaking the string in one but not the other but I would like for this to work in my Win32 application so I can link necessary DLLs. </p>