title: How to use credentials in powershell script to copy file to a destination server?
body: <p>I am trying to copy file from my local machine to a server destination</p>
  <p>My Script:  <code>Copy-Item –Path D:\Test.txt –Destination '\\10.10.X.X\c$'</code></p>
  <p>Error:</p>
  <pre><code>Copy-Item : The network path was not found
  At D:\PS_Test_script.ps1:1 char:2
  +  Copy-Item –Path D:\Test.txt –Destination '\\10.10.X.28X\c$'
  +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [Copy-Item], IOException
      + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand
  </code></pre>
  <p>The server has credentials, I am guessing that, I have to invoke something to use the credentials.</p>