title: How can I copy from local to a remote location with credentials in PowerShell?
body: <p>I am a fresh beginner to PowerShell.</p>
  
  <p>I have username and password to reach a shared folder in a remote location.</p>
  
  <p>I need <strong>to copy the file <code>foo.txt</code> from the current location to</strong> <code>\\Bar.foo.myCOmpany.com\logs</code> within a PS1 script that is written for <strong>Powershell v3.0</strong>.</p>
  
  <p>How can I achieve this?</p>