$ 0 0 Woops, sorry, I hadn't tested it. Just threw it together in Notepad quickly :) ($file.Name) was actually meant to be $($file.Name)