Copy files with progress indicator with Powershell

 

Copy files with progress indicator with Powershell

 

3 comments

  • I.
    Thank For This code.

    But.. If I want Exclude a folder… ?

    Exemple :
    $sourcepatch = “C:\Users\$Users\” [In this Folder I don’t want ‘APPDATA’ folder]

    Thank

     
    • LauraD2423 says:

      I can’t be sure, and can’t test right now, but I think all you have to do is add “-exclude to line 2 above on the Get-Childitem

       
  • J.Reyes says:

    You can use something like (-Exclude)

    $Exclude = (Get-ChildItem $DestinationPath -Recurse -ErrorAction SilentlyContinue)

    copy-Item $file.fullname -exclude $exclude ($destinationPath + $relativepath)

     

Leave a Reply

Your email address will not be published. Required fields are marked *