0

I want for each 5 minutes to call PowerShell script. The script:

$ie = New-Object -com InternetExplorer.Application 
$ie.navigate("https://www.google.com") 

however, script is executed, I can see blue console of PowerShell program, but it wont open IE to present me a website.

Settings in Action:

enter image description here

How to force script to open InternetExplorer, or Chrome?

2
  • Arguments: -NoProfile -WindowStyle Hidden -file "C:\bvc\openIE.ps1" Start in: c:\bvc\ Commented Sep 12, 2019 at 8:05
  • @f6a4 still the same Commented Sep 12, 2019 at 8:21

2 Answers 2

1

Your script should look like this (one line responsible for showing IE was missing):

$ie = New-Object -com InternetExplorer.Application 
$ie.navigate("https://www.google.com")
$ie.Visible=$true

Then it should work (tested on my Win7). Keep in mind, it's still a good practice to be more explicit while defining your task. For example, in current format it'd fail in case you have spaces in your script name.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks it works with this additional line. I thought that it will behave the same when I tested in VS Code..
0

Use in Program/script field

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

and add argument

-File "c:\bvc\openIE.ps1"

in your ps1 use this command

Start-Process iexplore -ArgumentList 'google.com' -passthru

1 Comment

still the same. it wont open IE11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.