Chapter 18. Working with COM
This chapter covers:
A horse! A horse! My kingdom for a horse!
King Richard in William Shakespeare’s
The Life and Death of King Richard III
At the end of Shakespeare’s Richard III, King Richard stands upon a plain, surrounded by foes, crying out for the one thing that he needs to continue on. Sort of like the noble sysadmin: “A tool! A tool! My kingdom for a tool!” Okay, perhaps not exactly like that, but at times, we do feel set upon from all sides, crying out desperately for something to help us solve our problems. Fortunately, we in the PowerShell world do get our horse: a framework called the Component Object Model (COM), which can help us win our battles by giving us access to the necessary facilities.
In this chapter, we’ll cover the important details of working with COM from PowerShell. We’ll look at a number of examples that illustrate how COM objects work and the sorts of tasks that can be accomplished. You’ll also learn how to leverage earlier Windows scripting technologies in PowerShell scripts.