Tutto questo, tempo fa, si sarebbe fatto solo con VBsctipt … ora invece… eh!🙂

Richard Siddaway's Blog

 

This is a common scenario

$word=New-Object-ComObject"Word.application"$word.visible=$true$doc=$word.Documents.Add()$doc.Activate()$word.Selection.Font.Name="Cambria"$word.Selection.Font.Size="20"$word.Selection.TypeText("PowerShell")$word.Selection.TypeParagraph()$word.Selection.Font.Name="Calibri"$word.Selection.Font.Size="12"$word.Selection.TypeText("The best scripting language in the world!")$word.Selection.TypeParagraph()$file="c:\scripts\office\test1.doc"$doc.SaveAs([REF]$file)$Word.Quit()

Create a new Word document – put some text into it and save it with a given file name.  I’ve used it successfully to create server documentation.

Unfortunately with PowerShell v3 it fails…

View original post 312 altre parole