Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - InternetExplorer.Application COM object.

Reply
 
Old 05-23-2008   #1 (permalink)
Braden C. Roberson-Mailloux


 
 

InternetExplorer.Application COM object.

I'm new to COM development.

new-variable html
$a = ([xml](new-object
net.webclient).downloadstring("http://blogs.msdn.com/powershell/rss.aspx")).rss.channel.item
$oIE = new-object -COM InternetExplorer.Application
$oIE.navigate2(about:blank)
$oIE.statusbar=$True
$oIE.addressbar=$False
$oIE.menubar=$False
$oIE.toolbar=$False
$b = $a | select $link,title,pubdate | convertto-html | %
{$_.replace("&lt;","<").replace("&gt;",">")}
$oIE.document.body.insertAdjacentHTML
$oIE.visible=$True

I'm trying to spawn an IE window whenever powershell starts. This windows
will display the above rss feeds as links. The script isn't crashing,
however the windows which spawns contains no data. I'm using IE 7 and
Powershell v1.



My System SpecsSystem Spec
Old 05-24-2008   #2 (permalink)
Shay Levi


 
 

Re: InternetExplorer.Application COM object.



Hi Braden,

Try this, if you want it to be poped up each time PowerShell loads, wrap
it in a function, put it in your profile
and add a call to the function:


### $profile ###

function get-rss{
$a = ([xml](new-object net.webclient).downloadstring("http://blogs.msdn.com/powershell/rss.aspx")).rss.channel.item
$oIE = new-object -com internetExplorer.application
$oIE.navigate2("about:blank")
$oIE.statusbar=$true
$oIE.addressbar=$false
$oIE.menubar=$false
$oIE.toolbar=$false
$link = @{n="Title";e={"<a href='$($_.link)'>$($_.title)</a>"}}
$b = $a | select $link,pubdate | convertto-html | foreach {$_.replace("&lt;","<").replace("&gt;",">")}
$oIE.document.body.innerHTML = $b
$oIE.visible=$true
}

get-rss

########



---
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> I'm new to COM development.
>
> new-variable html
> $a = ([xml](new-object
> net.webclient).downloadstring("http://blogs.msdn.com/powershell/rss.as
> px")).rss.channel.item
> $oIE = new-object -COM InternetExplorer.Application
> $oIE.navigate2(about:blank)
> $oIE.statusbar=$True
> $oIE.addressbar=$False
> $oIE.menubar=$False
> $oIE.toolbar=$False
> $b = $a | select $link,title,pubdate | convertto-html | %
> {$_.replace("&lt;","<").replace("&gt;",">")}
> $oIE.document.body.insertAdjacentHTML
> $oIE.visible=$True
> I'm trying to spawn an IE window whenever powershell starts. This
> windows will display the above rss feeds as links. The script isn't
> crashing, however the windows which spawns contains no data. I'm using
> IE 7 and Powershell v1.
>

My System SpecsSystem Spec
Old 05-24-2008   #3 (permalink)
Alex K. Angelopoulos


 
 

Re: InternetExplorer.Application COM object.

"Lionel Fourquaux" <use.reply-to@xxxxxx-spam.invalid> wrote in message
news:slrng3guda.al6.use.reply-to@xxxxxx
Quote:

> Which version of Windows are you testing this on? Does it work if you
> disable IE Protected Mode (on Vista)?
>
> IE 7 on Vista will create a new process (with a restricted token) for
> Protected Mode, which will break some COM relationships. This appears
> to be fixed in IE 8 beta 1.
EUREKA!
I never was able to figure that out. Ironically, I upgraded to IE8 Beta 1
and started running it in IE7 compatibility mode before I got my IE scripts
(PowerShell and WSH) working again. It now works well enough - I was able to
export a few hundred messages from a Sakai web system for someone via
PowerShell-based IE automation.

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
InternetExplorer Com Object Find Utility PowerShell
Give focus to an InternetExplorer.Application object VB Script
Re: InternetExplorer.Application COM object. PowerShell
REQ: internetexplorer com object and access to array of links PowerShell
new-object -com internetexplorer.application PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46