title: Get file "last saved by" property without changing it
body: <p>I try to get the properties (owner) of a file with the line of code in PowerShell:</p>
  
  <pre><code>    $file = "\\networkshare\directory\file.doc"
      Get-ItemProperty -Path $file | Format-list -Property * -Force
  </code></pre>
  
  <p>It is easy to extract the owner, modified date, etc. But I want to extract the "last saved by' and 'revision number':</p>
  
  <p><a href="https://i.stack.imgur.com/akTjF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/akTjF.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Update:</strong></p>
  
  <p>The following code seems to work. But every time I run the script it changes the value of "last saved by". How to prevent this and only read the property?</p>
  
  <pre><code> $word = New-Object -Com Word.Application
  $word.Visible = $false #to prevent the document you open to show
  $doc = $word.Documents.Open("\\networkshare\directory\file.doc")
  
  $binding = "System.Reflection.BindingFlags" -as [type]
  Foreach($property in $doc.BuiltInDocumentProperties) {
     try {
        $pn = [System.__ComObject].invokemember("name",$binding::GetProperty,$null,$property,$null)
        if ($pn -eq "Last author") {
           $lastSaved = [System.__ComObject].invokemember("value",$binding::GetProperty,$null,$property,$null)
           echo "Last saved by: "$lastSaved      
        }        }
     catch { }
  }
  
  $doc.Close()
  $word.Quit()
  </code></pre>