0

I am using Copy-Item of powershell to copy files from source to destination. Below is the command which I am using.

Copy-Item -Path $fpath -Destination D:\abc\copy_location

$fpath being $fpath = $Event.SourceEventArgs.FullPath

While testing I found that it was able to copy small files but it wasn't able to copy large files (~300 - 400 MB). I have files max of around 400 MB which I have to copy from source to destination. I saw a post in stackoverflow - "Copy-Item fails on large file" where it said to use doubt quotes in the path ... i tried that as well but no success.

Please kindly advise what to do? The other option which I understand is to use robocopy command. The command being:

robocopy source destination file_to_copy

Here I am facing one issue my source is $fpath, but it gives me the full path upto the file. I only want the path upto the folder.

user10675448
  • 23
  • 1
  • 5
  • What error message do you get? Maybe you wnat to write your own cmdlet? If yes, try this: https://stackoverflow.com/questions/2434133/progress-during-large-file-copy-copy-item-write-progress – Sebastian Siemens Nov 26 '18 at 14:58
  • I don't get any error message... when I go to the destination folder I see that the file is not there ...I don't want to monitor its progress I just want to ensure that the file is fully written before the copy starts. – user10675448 Nov 26 '18 at 15:26
  • please kindly share your views ... I am unable to solve this. – user10675448 Dec 01 '18 at 06:36

1 Answers1

0

Still hit the same problem a few years later, when copying large files from Linux to Windows using PowerShell. Smaller filers from the same folder were copied successfully, but failed on larger files. Found a solution at the end of this https://github.com/powershell/powershell/issues/4952

Basically, you need to set MaxEnvelopeSizekb to a bigger value, 1000 worked for me for files over 6MB.

NathW
  • 1