Using the New-Object Cmdlet

The use of objects in Windows PowerShell provides many exciting opportunities to do things that are not "built into" the PowerShell. You may recall from using VBScript that there is an object called the wshShell object. If you are not familiar with this object, a drawing of the object model is shown in Figure 2-1.

The VBScript wshShell object contributes many easy-to-use methods and properties for the network administrator

Figure 2-1. The VBScript wshShell object contributes many easy-to-use methods and properties for the network administrator

Note

Just the Steps To create a new instance of the wshShell object, use the New-Object cmdlet while specifying the -comobject argument and supplying the program ID of "wscript.shell". Hold ...

Get Microsoft® Windows PowerShell™ Step By Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.