internetexplorer.application performance

Hi

I made a small script that displays some information via HTML and Internet Explorer:

$ie = New-Object -com internetexplorer.application;
$ie.navigate2("about:blank") 
$ie.document.body.innerHTML = $html
$ie.visible = $true
$ie.MenuBar = $false
$ie.AddressBar = $false
$ie.StatusBar = $false
$ie.ToolBar = $false

This works well. The problem is that i made some buttons on the page that should refresh the content. But when powershell needs to pull that information:

do {
            if ($ie.Document.getElementByID("finished").value -eq 1) {
                $skip = $true
            }
            if ($ie.Document.getElementByID("autorefresh").value -eq 1) {
                $autorefresh = $true
            }
            Start-Sleep -Milliseconds 500
} until (($autorefresh -eq $true) -or ($skip -eq $true))

I get a high CPU load (40-45%).

Is this normal, or should it be done another way?

February 12th, 2014 12:29am

Hi ThomasICG,

Did you get any script error?

For the CPU load, if this only occurs when running the script, I think that's OK, because running powershell script will consume the cpu load.

Best Regards,

Anna

Free Windows Admin Tool Kit Click here and download it now
February 12th, 2014 12:07pm

Hi ThomasICG,

Did you get any script error?

For the CPU load, if this only occurs when running the script, I think that's OK, because running powershell script will consume the cpu load.

Best Regards,

Anna

No the script is working. I was just wondering if there was somehow to reduce the CPU load. As it is a script that would be running all the time on a monitor PC.
February 12th, 2014 12:41pm

Hi ThomasICG,

I am trying to involve someone familiar with this topic to further look at this issue.

There might be some time delay. Appreciate your patience.

If you have any feedback on our support, please click here.

Best Regards

Anna

TechNet Community Support

Free Windows Admin Tool Kit Click here and download it now
February 14th, 2014 1:21am

Hi,

i would like to know what's the result as you expect. low CPU load?

Regards,

Mike

February 18th, 2014 4:07am

Hi,

i would like to know what's the result as you expect. low CPU load?

Regards,

Free Windows Admin Tool Kit Click here and download it now
February 18th, 2014 5:07am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics