title: Count characters for each line
body: <p>I am new to WinPowerShell. Please, would you be so kind to give me some code or information, how to write a program which will do for all *.txt files in a folder next:
  1.Count characters for each line in the file
  2. If length of line exceeds 1024 characters to create a subfolder within that folder and to move file there (that how I will know which file has over 1024 char per line)</p>
  
  <p>I've tried though VB and VBA (this is more familiar to me), but I want to learn some new cool stuff!</p>
  
  <p>Many thanks!</p>
  
  <p>Edit: I found some part of a code that is beginning</p>
  
  <pre><code>$fileDirectory = "E:\files";
  foreach($file in Get-ChildItem $fileDirectory)
      {
         # Processing code goes here
      }
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>$fileDirectory = "E:\files";
  foreach($line in Get-ChildItem $fileDirectory)
  {
   if($line.length -gt 1023){# mkdir and mv to subfolder!}
  }
  </code></pre>