title: Add Copyright As a New Member to Get-Process
body: <p>I have a PowerShell script, which contain:<br />
  1. <code>$GetP</code>: Variable which is (Get-Process Command)<br />
  2. <code>$path</code> and <code>$getfile</code>: is two variable for getting all process paths in <code>$GetP</code> Path.<br />
  3. the <code>foreach</code> syntax: is a method to getting all paths in $getfile (LegalCopyright).<br />
  ...<br />
  Now I want to Add <strong>Copyright</strong> As a New Member to <code>$GetP</code> or <code>Get-Process</code> for each paths.<br />
  <br /><strong>Her's my Wrong Syntax:</strong></p>
  
  <pre><code>$GetP = Get-Process
  
  $path = $GetP | select -ExpandProperty  Path
  $getfile = dir $path -Include *.* -recurse 
  
  foreach ($iffile in $getfile)
  {
  
          $fname = $iffile.FullName
          $vfile = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($fname)
          $Copyright = $vfile.LegalCopyright
  
          #$Copyright
  
  } 
  
  
  $FileCopyRight = foreach ($Copyright in $GetP) {
      $fpmvar = $vfile.LegalCopyright
      $Copyright | Add-Member -NotePropertyName CopyRight -NotePropertyValue $fpmvar -PassThru
    }
  
  
  $GetP | select CopyRight
  </code></pre>
  
  <p>Note: When you remove the '#' comment in <code>$Copyright</code>, it will show you all CopyRights.</p>