May 2007
Beginner
320 pages
8h 23m
English
In this exercise, we create a couple of objects.
Start Windows PowerShell by using Start | Run | Windows PowerShell. The PowerShell prompt will open by default at the root of your Documents And Settings.
Create an instance of the wshNetwork object by using the New-Object cmdlet. Use the comobject argument, and give it the program ID for the wshNetwork object, which is "wscript.network". Store the results in a variable called $wshnetwork. The code looks like the following:
$wshnetwork = new-object -comobject "wscript.network"
Use the EnumPrinterConnections method from the wshNetwork object to print out a list of printer connections that are defined on your local computer. To do this, use the wshNetwork object ...
Read now
Unlock full access