Powershell cmdlets process data one record at a time. If you pass the get-childitem output to a script block or other cmdlet, it should run as parallel. That is, your script block will be executed as soon as a record is available, while get-childitem is still retrieving the records. Of course, since this is a console application, the console will naturally be locked until all records have been processed, unless you offer the user more data during record processing or the user completes the command. If you have time / resource handling, you might want your cmdlet to use a background job (see this msdn article ).
source share