Powershell: how to check if any instance of internet explorer is already running -


i want check if instance of internet explorer, ie window of it, opened or not can decide new object has created or have attach existing process of ie window. code below:

$ie = (new-object -com "shell.application").windows()| ? { $_.name -eq "windows internet    explorer" } 

i want attach windows() when window of ie opened , if no ie window opened line should this:

$ie = (new-object -com "shell.application") 

try:

if (      get-process iexplore -ea silentlycontinue |       where-object {$_.mainwindowtitle -ne ""} ) 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -