locked
refresh IE with power shell RRS feed

  • Question

  • hi ,

    how to refresh an IE tab using power shell ? [I want to refresh only the tab that contains my application url , not other IE windows or tabs ]

    thx

    Tuesday, August 28, 2012 9:53 AM

Answers

  • $YouAppLink = "http://app.site.com/qwerty"
    $ieSet = (New-Object -ComObject Shell.Application).Windows() |  ? {$_.LocationUrl -like "$YouAppLink"}
    $ieSet.Refresh()
    


    Сазонов Илья http://isazonov.wordpress.com/

    • Proposed as answer by Kazun Tuesday, August 28, 2012 11:28 AM
    • Marked as answer by Yan Li_ Monday, September 3, 2012 2:22 AM
    Tuesday, August 28, 2012 11:27 AM

All replies

  • I tested only Windows 7 x86 Pro:

    1) download util tlbimp.exe from Windows SDK

    2) Export library TlbImp.exe shdocvw.dll /out:D:\Interop.shdocvw.dll

    #urls to find
    $url = "social"
    
    #load library
    add-type -Path D:\Interop.shdocvw.dll
    
    #enum urls
    $urls = New-Object Interop.shdocvw.ShellWindowsClass
    #Refresh
    $urls | Where {$_.LocationURL -match $url} | Foreach {$_.Refresh()}
    

    Tuesday, August 28, 2012 11:20 AM
  • $YouAppLink = "http://app.site.com/qwerty"
    $ieSet = (New-Object -ComObject Shell.Application).Windows() |  ? {$_.LocationUrl -like "$YouAppLink"}
    $ieSet.Refresh()
    


    Сазонов Илья http://isazonov.wordpress.com/

    • Proposed as answer by Kazun Tuesday, August 28, 2012 11:28 AM
    • Marked as answer by Yan Li_ Monday, September 3, 2012 2:22 AM
    Tuesday, August 28, 2012 11:27 AM
  • Hey, guys

    I know this topic is old, but i have a problem this script

    In short links works perfect, but in long links appears a mensage is:

    you don't call value null 

    Saturday, December 21, 2019 2:09 PM