Is there an easy way to verify all files were copied correctly when calling copy-item? I thought about using the checksum on all files, but I would imagine powershell (v2) would already have something, and I can't find it.
+2
A:
No there isn't and here is why. Copy-Item is a generic cmdlet that works for all namespace providers. So the items being copied could be files, or registry settings, or IIS configuration sections, etc. Verifying a file copy is quite a bit different than verifying a copy of registry settings.
So if you are doing file copying and really need verification, there is always good old XCOPY. Still works fine from PowerShell.
XCOPY source destination /V
[tastes great, less filling] ;-)
Mark Arnott
2010-01-18 18:20:09
A:
I know it's an old thread, but I thought I'd post this just in case anyone else is reading it... the /v switch DOES NOT verify the data! It just makes sure that the copy is readable. See http://support.microsoft.com/kb/126457 for details.
Cheers, Dave
Dave S
2010-07-30 14:23:21