#TodayILearned that to get rid of the Word process after you’ve read a file like this:
$word = New-Object -ComObject Word.Application $Doc = $word.Documents.Open(‘Pogues.docx’ , $false, $true) $text = $Doc.Content.Text $Text
You can do this:
$word.Quit()