I'm trying to loop through the directory DirIn, remove the first two lines from each csv file, and then save those files in a new directory DirOut. The following code is what I've pieced together from other forums, but I cannot get the code to work. Any help would be greatly appreciated.
gci "DirIn\*.csv" | % {(gc $_ | select -Skip 2) | sc "DirOut\$_" }