Chapter 18. Working with COM

 

This chapter covers:

  • 18.1 Working with COM in PowerShell
  • 18.2 Automating Windows with COM
  • 18.3 Working with the WScript.Shell class
  • 18.4 Using COM to manage applications
  • 18.5 The WSH ScriptControl class
  • 18.6 Working with the Windows Task Scheduler
  • 18.7 Issues with COM
  • 18.8 Summary

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.

18.1. Working With COM In PowerShell

18.2. Automating Windows With COM

18.3. Working With the WScript.Shell Class

18.4. Using COM to Manage Applications

18.5. The WSH Scriptcontrol Class

18.6. Working With the Windows Task Scheduler

18.7. Issues With COM

18.8. Summary