Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

InternetExplorer.Application COM object.

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 05-23-2008   #1 (permalink)
Braden C. Roberson-Mailloux
Guest


 

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
Guest


 

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
Guest


 

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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
InternetExplorer.Application and Windows Vista nuytkens.stanny VB Script 0 06-17-2008 06:29 AM
Re: InternetExplorer.Application COM object. Jon PowerShell 2 05-26-2008 03:52 PM
REQ: internetexplorer com object and access to array of links Robertico PowerShell 8 05-21-2008 01:38 PM
new-object -com internetexplorer.application Shawn Dumas PowerShell 3 09-19-2007 09:01 AM
Binding a powershell variable to the COM Object of a running application. Mugunth PowerShell 5 05-05-2007 05:56 PM


Vistax64.com 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 2005-2008

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 47 48 49 50 51