Online Test Banks
Score higher
See Online Test Banks
eLearning
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

Creating COM and .NET Objects with Windows PowerShell 2

Part of the Windows PowerShell 2 For Dummies Cheat Sheet

PowerShell 2 enables you to automate your Windows operating system, which entails dealing with objects: COM objects are created using the New-Object method with the -comobject parameter, whereas .NET objects are created by enclosing the class name in square brackets. An example of each follows:

$objWord = New-Object -comobject "Word.Application"
$objWord.visible = $true
$objWord.Quit
$ips = [System.Net.Dns]::GetHostAddresses("www.dummies.com")
$ips | Select-Object IPAddressToString
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus

SERIES
Windows PowerShell 2 For Dummies Cheat Sheet

Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.