How to ignore Robocopy access denied errors in psake?
<p>I am writing psake task for copying a folder to another folder as below.</p>

<pre><code>task -name CopyComponentToBundle -description "Copy the component to bundle" -action {

    Write "Component source is $ComponentPath"
    Write "Component Destination is $ComponentBundlePath"
    exec {      

        Robocopy $ComponentPath $ComponentBundlePath  /MIR /R:0 /W:0
    }   
}
</code></pre>

<p>though folders are successfully copied still i am getting error as below.</p>

<blockquote>
  <p>At C:\Program Files\WindowsPowerShell\Modules\psake\psake.psm1:156
  char:17 +                 throw ("Exec: " + $errorMe ssage) +<br>
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [&lt;&lt;==>>] Exception: Exec: Error
  executing command
                                  Roboc opy $ComponentPath $ComponentBundlePath  /MIR /R:0 /W:0 .</p>
</blockquote>

<p>Is there a way to ignore the errors? All the errors were "Access is denied".</p>