new-object
new-object创建了.net framework或者com对象的实例。
You can specify either the type of a .NET Framework class or a ProgID of a COM object. By default, you type the ful
ly qualified name of a .NET Framework class and the cmdlet returns a reference to an instance of that class. To cre
ate an instance of a COM object, use the ComObject parameter and specify the ProgID of the object as its value.
new-object -ComObject
$ie= New-Object -ComObject "internetExplorer.application"; $ie.visible=$true
$excel= New-Object -ComObject "excel.application"; $excel.visible=$true
要是想了解ie对象有哪些属性,可以输入:
New-Object -ComObject "internetExplorer.application"