{"id":10711,"date":"2006-04-25T12:18:00","date_gmt":"2006-04-25T12:18:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2006\/04\/25\/getobject\/"},"modified":"2019-02-18T13:24:59","modified_gmt":"2019-02-18T20:24:59","slug":"getobject","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/getobject\/","title":{"rendered":"GetObject()"},"content":{"rendered":"<p>Monad provides a way to create new com objects with new-object<\/p>\n<p><font face=\"Courier New\" color=\"#ff0000\" size=\"1\">$ie = New-Object -ComObject InternetExplorer.Application<br \/>$ie.Navigate2(<\/font><a href=\"http:\/\/blogs.msdn.com\/monad\"><font face=\"Courier New\" color=\"#ff0000\" size=\"1\">http:\/\/blogs.msdn.com\/monad<\/font><\/a><font face=\"Courier New\" color=\"#ff0000\" size=\"1\">)<br \/>$ie.Visible=1<\/font><\/p>\n<p>Great but what about if you want to bind to an existing object?&nbsp; Where is the equivalent of GetObject()?<\/p>\n<p>This is one of those good new\/bad news stories.&nbsp; First the bad news.&nbsp; Monad does not provide a Cmdlet that exposes this function.&nbsp; Alas, to ship is to choose and we are not going to get to in for V1.&nbsp; Now for the good news.&nbsp; Monad provides great .NET support and .NET exposes this function.<\/p>\n<p><font face=\"Courier\" color=\"navy\" size=\"2\"><span>&nbsp;<\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font color=\"#ff0000\"><span><font face=\"Courier New\"><font size=\"1\"><font color=\"#ff0000\">MSH<\/font><font color=\"#ff0000\">&gt; $w=[System.Runtime.InteropServices.Marshal]::GetActiveObject(&#8220;Word.Application&#8221;)<\/font><\/font><\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\"><span><\/span><font color=\"#ff0000\"><span><font face=\"Courier New\" color=\"#ff0000\" size=\"1\">MSH&gt;<\/font><font face=\"Courier New\" color=\"#ff0000\" size=\"1\"> $w.documents |ft name,path -auto<br \/><\/font><\/span><\/font><font face=\"Courier New\" color=\"#ff0000\" size=\"1\"><span><font face=\"Courier New\" color=\"#ff0000\" size=\"1\">Name<\/font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face=\"Courier New\" color=\"#ff0000\" size=\"1\">Path<\/font><br \/><\/span><\/font><font face=\"Courier New\" color=\"#ff0000\"><span><font size=\"1\"><font color=\"#ff0000\">&#8212;-<\/font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=\"#ff0000\">&#8212;-<\/font><br \/><\/font><\/span><\/font><font face=\"Courier New\"><font size=\"1\"><font color=\"#ff0000\"><span><font color=\"#ff0000\">RE: Question regarding Word scripting with MSH&#8230; RE:<br \/><\/font><\/span><span><font color=\"#ff0000\">cmdlets as classes.doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=\"\/\/imself-dfs-07\/dfsroot\/dfsmydocs\/js...Event\">\\\\imself-dfs-07\\dfsroot\\dfsmydocs\\js&#8230;<\/span><\/font><\/font><\/font><span><font face=\"Courier New\" color=\"#ff0000\" size=\"1\">Event<\/font><\/a><font face=\"Courier New\" color=\"#ff0000\" size=\"1\"> Schema.doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \\\\imself-dfs-07\\dfsroot\\dfsmydocs\\js..<\/font><font size=\"1\"><font face=\"Courier New\"><font color=\"#ff0000\">.<\/span><\/font><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span>&nbsp;<\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span>Let me be quick to point out a problem that exists in your beta code but is fixed in the upcoming release.&nbsp; If you just typed $w.Documents &#8211; it is going to appear to have hung and you&#8217;ll either have to wait a&nbsp;LONG time or hit CTRL-BREAK to terminate the session.&nbsp; The work around is very simple, pipe the output to Get-Member and use that to find out what properties you want and then ask for those specific properties.<\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span>Anyway, this is an example of how Monad&#8217;s support for a wide range of technologies (text processing, COM, WMI, ADSI, ADO, XML, .NET, etc) really pays off.&nbsp; As a rule, we are trying to expose the system with Cmdlet and namespace semantics.&nbsp; It is going to take a while before the entirety of the system is exposed this way but by providing direct access to these other technologies, it enables the community to provide this support.&nbsp; For example the function:<\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Courier New\" color=\"#ff0000\" size=\"1\"><span><font face=\"Courier New\" color=\"#ff0000\" size=\"1\"><\/font><\/span><\/font>&nbsp;<\/p>\n<p class=\"MsoNormal\"><font face=\"Courier New\" color=\"#ff0000\" size=\"1\"><span><font face=\"Courier New\" color=\"#ff0000\" size=\"1\">Function Get-Object ($ProgID) {<\/font><br \/><\/span><\/font><span><font face=\"Courier New\" color=\"#ff0000\" size=\"1\">[System.Runtime.InteropServices.Marshal]::GetActiveObject($ProgID)<br \/>}<\/font><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span><\/span><\/font>&nbsp;<\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span>and the following formating directives:<br \/><font color=\"#ff0000\"><\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span><font color=\"#ff0000\">&lt;Configuration&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;ViewDefinitions&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;View&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Name&gt;CustomView&lt;\/Name&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ViewSelectedBy&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TypeName&gt;System.__ComObject#{0002096b-0000-0000-c000-000000000046}&lt;\/TypeName&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/ViewSelectedBy&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TableControl&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TableHeaders&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TableColumnHeader&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Label&gt;Name&lt;\/Label&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Width&gt;20&lt;\/Width&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/TableColumnHeader&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TableColumnHeader&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Label&gt;FullName&lt;\/Label&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/TableColumnHeader&gt;<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"#ff0000\" size=\"2\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=\"#ff0000\">&lt;\/TableHeaders&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TableRowEntries&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TableRowEntry&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TableColumnItems&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TableColumnItem&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;PropertyName&gt;Name&lt;\/PropertyName&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/TableColumnItem&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TableColumnItem&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;PropertyName&gt;FullName&lt;\/PropertyName&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/TableColumnItem&gt;<br \/><\/font><\/span><\/font><font face=\"Arial\" color=\"navy\" size=\"2\"><span><font color=\"#ff0000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/TableColumnItems&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/TableRowEntry&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/TableRowEntries&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/TableControl&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;\/View&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp; &lt;\/ViewDefinitions&gt;<br \/>&lt;\/Configuration&gt;<\/font> <\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span><\/span><\/font>&nbsp;<\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span>allows us to do the following:<\/span><\/font><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#ff0000\"><font size=\"1\"><font face=\"Courier New\"><strong><\/strong><\/font><\/font><\/font><\/span>&nbsp;<\/p>\n<p class=\"MsoNormal\"><span><font color=\"#ff0000\"><font size=\"1\"><font face=\"Courier New\"><strong>MSH&gt; $w = Get-Object -ProgId Word.Application<br \/><\/strong><font color=\"#ff0000\"><span><font color=\"#ff0000\">MSH&gt; $w.documents<\/font> <br \/><\/span><\/font><\/font><\/font><\/font><font color=\"#ff0000\"><span><font face=\"Courier New\"><font size=\"1\"><font color=\"#ff0000\">Name<\/font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=\"#ff0000\">Fullname<\/font><br \/><\/font><\/font><\/span><\/font><font face=\"Courier New\" color=\"#ff0000\"><span><font size=\"1\"><font color=\"#ff0000\">&#8212;-<\/font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#ff0000\">&#8212;&#8212;&#8211;<br \/><\/font><\/font><\/span><\/font><font color=\"#ff0000\"><font size=\"1\"><font face=\"Courier New\"><span><font color=\"#ff0000\" size=\"1\">RE: Question regarding Word scripting with MSH&#8230; RE:<br \/><\/font><\/span><span><font color=\"#ff0000\" size=\"1\">cmdlets as classes.doc<\/font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=\"\/\/imself-dfs-07\/dfsroot\/dfsmydocs\/js...Event\"><font color=\"#ff0000\">\\\\imself-dfs-07\\dfsroot\\dfsmydocs\\js&#8230;<\/font><\/span><span><font color=\"#ff0000\">Event<\/font><\/a><font color=\"#ff0000\"> Schema.doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><a href=\"\/\/imself-dfs-07\/dfsroot\/dfsmydocs\/js\"><font color=\"#ff0000\">\\\\imself-dfs-07\\dfsroot\\dfsmydocs\\js<\/font><\/a><font color=\"#ff0000\">&#8230;<\/font><\/span><\/font><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\"><span><font face=\"Courier\" color=\"navy\" size=\"1\"><span><\/span><\/font><\/span><\/font>&nbsp;<\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span><font face=\"Courier\" color=\"navy\" size=\"2\"><span>Extend the system and Enjoy!<\/span><\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Arial\" color=\"navy\" size=\"2\"><span><font face=\"Courier\" color=\"navy\" size=\"2\"><span>Jeffrey P. Snover<br \/>Monad Architect<\/span><\/font><\/span><\/font><font face=\"Arial\" color=\"navy\" size=\"2\"><span><\/p>\n<p><\/span><\/font><\/p>\n<p>[<i>Edit: Monad has now been renamed to Windows PowerShell. This script or discussion may require slight adjustments before it applies directly to newer builds.<\/i>]<\/p>\n<p>PSMDTAG:TYPE:COM: InternetExplorerer.Application<\/p>\n<p>PSMDTAG:FAQ: What is the equivalent of VBSCRIPT&#8217;s GetObject()?&nbsp; Answer: [<font color=\"#000000\">System.Runtime.InteropServices.Marshal]::GetActiveObject(&#8220;progid&#8221;)<\/font><\/p>\n<p>PSMDTAG:FORMATEXTENSION: (Word.Application).Documents<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Monad provides a way to create new com objects with new-object $ie = New-Object -ComObject InternetExplorer.Application$ie.Navigate2(http:\/\/blogs.msdn.com\/monad)$ie.Visible=1 Great but what about if you want to bind to an existing object?&nbsp; Where is the equivalent of GetObject()? This is one of those good new\/bad news stories.&nbsp; First the bad news.&nbsp; Monad does not provide a Cmdlet that [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[13,10],"class_list":["post-10711","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-com","tag-faq"],"acf":[],"blog_post_summary":"<p>Monad provides a way to create new com objects with new-object $ie = New-Object -ComObject InternetExplorer.Application$ie.Navigate2(http:\/\/blogs.msdn.com\/monad)$ie.Visible=1 Great but what about if you want to bind to an existing object?&nbsp; Where is the equivalent of GetObject()? This is one of those good new\/bad news stories.&nbsp; First the bad news.&nbsp; Monad does not provide a Cmdlet that [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/10711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=10711"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/10711\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=10711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=10711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=10711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}