title: Running Powershell script within Powershell 'silently'
body: <p>My setup:</p>
  
  <p>One Powershell script with a menu. Upon selecting a a menu item, a specific Powershell script is run assigned to that menu item.
  I'm attempting to make this second Powershell script run silently as in - nothing is shown in the main Powershell script.</p>
  
  <p>Bonus:
  The full setup I'm looking at is:</p>
  
  <ul>
  <li>User runs Powershell script</li>
  <li>User selects a menu item (this executes another Powershell script)</li>
  <li>The information in the other Powershell script is not shown to the user</li>
  <li>After the second Powershell script has been executed, the user is shown a line of text such as: "Script has been run successfully"</li>
  </ul>
  
  <p>What I've tried:
  Adding the following code to each secondary script</p>
  
  <pre><code>$t = '[DllImport("user32.dll")] public static extern bool ShowWindow(int handle, int state);'
  add-type -name win -member $t -namespace native
  [native.win]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0)
  </code></pre>
  
  <p>Unfortunately this closes the main Powershell window which isn't what I desire.</p>