by 99zeros at 2012-11-16 11:08:07

Greetings :slight_smile:

I am hoping someone can answer this for me. I have written a powershell script to automate the pushing and zipping of a package. We used to just to it within the windows GUI.

When I drag and drop the folder in windows it takes about 60 seconds for the single zip file to copy over. In my powershell script I use Copy-Item and it takes about 15 minutes for the copy to complete. The copy is from a UNC to a local drive. Any ideas as to why this is taking sooooo much longer?

I appreciate any help.

by DonJ at 2012-11-16 11:11:49
Because .NET’s file I/O routines suck.

PowerShell v3, which uses .NET 4.0, should be a bit better. They did some work on those low-level routines for this exact situation. But, if you can’t use that, or if that’s still pokey, consider just running Cmd.exe and using the native copy (or XCopy, or Robocopy) command as a workaround.