How can I use PowerShell to `save as…` a different file extension?
问题 This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 7 years ago . I'm using the following powershell script to open a few thousand HTML files and "save as..." Word documents. param([string]$htmpath,[string]$docpath = $docpath) $srcfiles = Get-ChildItem $htmPath -filter "*.htm*" $saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat], "wdFormatDocument"); $word = new-object -comobject word.application $word.Visible = $False