title: Adding a progress bar to copy file script
body: <pre class="lang-psh prettyprint-override"><code>$destinationFolder = "C:\Users\Jimmy\Desktop\Saves"
  $rootFolder = "C:\Users\Jimmy\Desktop\test"
  $subFolder = "\sales"
  $fileName = "hello.txt"
  
  $Dir = get-childitem $rootFolder |
         select -first 10 |
         ?{ $_.PSIsContainer } |
         Sort-Object { [regex]::Replace($_.Name, '\d+', { $args[0].Value.PadLeft(20) }) }
  
  [array]::Reverse($Dir)
  
  $Dir | format-table FullName
  
  Foreach ($i in $Dir){
    if(Test-Path $($i.FullName + $subFolder + "\" + $fileName)){
      #echo $($i.FullName + $subFolder)
      get-childitem $($i.FullName + $subFolder) |
        where {$_.Name.ToLower() -eq $fileName.ToLower()} |
        Copy-Item -Destination $destinationFolder
      echo $("just copied " + $fileName + " from " + $i.FullName.Trim())
      break;
    }else{
      echo $("Could not find " + $fileName + " in " + $i.FullName.Trim())
    }
  }
  </code></pre>
  
  <p>I usually use this script to copy large files from one location to another. I want to add a progress bar so I have some indication of the file being copied etc.</p>
  
  <p>I would like to add a <code>write-progress [ooooo     ]</code> type of thing, but I'm unsure how to do it.</p>