title: Easiest/shortest command to run a PowerShell script as a build event in Visual Studio
body: <p>Just getting started with PowerShell.  I was running DOS .bat files in my post build events in VS and wanted to graduate up to PowerShell.  Bat files were easy...<code>CALL something.bat</code>.  I tried to do that with a PowerShell ps1 file and my trial-and-erroring got me to the following (first thing that worked...tried all the simple things first, obviously):</p>
  
  <pre><code>powershell -command "&amp; {(powershell '$(ProjectDir)test.ps1')}"
  </code></pre>
  
  <p>Is there a shorthand version of this?  I think the only thing that really bothers me is the redundant calls to the powershell executable, but that's probably only required because .ps1 files open in notepad by default on my machine (and I should keep the redundancy for deployment on other systems so I'm not reliant on the default program for a file type).  Anyway, if there's unnecessary redundancy here, I'd love to know.</p>
  
  <p>I'm very new to PowerShell, so any related insight is always appreciated.</p>