title: Invoking powershell cmdlet from C++
body: <p>I'm using Visual Studio 2010 with a C++ project. I want to execute a <code>"Set-SmbServerConfiguration –EncryptData $true"</code> cmdlet from my c++ code. </p>
  
  <p>I tried with system() but its not working. May be its getting stuck at confirm option after executing command as follow:</p>
  
  <pre><code>Confirm
  Are you sure you want to perform this action?
  Performing operation 'Modify' on Target 'SMB Server Configuration'.
  [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
  </code></pre>
  
  <p>Is there any way to do this with default confirmation value("Y") from c++ code in windows? </p>