Problem
You want to create a COM object to interact with its methods and properties.
Solution
Use the NewObject cmdlet (with the –ComObject parameter) to create a COM object from its ProgID. You can then interact with the methods and properties of the COM object as you would any other object in PowerShell.
$object = NewObject ComObject ProgId
For example:
PS >$sapi = NewObject Com Sapi.SpVoice PS >$sapi.Speak("Hello World")
Discussion
Historically, many applications have exposed their scripting and administration interfaces as COM objects. While .NET APIs (and PowerShell cmdlets) are becoming more common, interacting with COM objects is still a common administrative task.
As with classes in the .NET Framework, it is difficult to know what COM objects you can use to help you accomplish your system administration tasks. For a handpicked list of the COM objects most useful to system administrators.
For more information about the NewObject cmdlet, type GetHelp NewObject.