I am writing a PowerShell script that launches a site in IE, authenticates and logs into the web page which is working fine.
But I wanted to log out of it (gracefully) rather than just closing ie.
Below (bottom of this) is the element in the web page but I can’t seem to get the right combination in PowerShell to log out of the web page. I tried:
$IE.Document.getElementById(“header:header_info:linklogout”).onclick()
But that didn’t work - tried just a .click and then tried .return but none of those worked. If anyone can point me in the right direction - I’d greatly appreciate it!
Element:
id=“header:header_info:linklogout” style=“color: rgb(79, 33, 112); margin-right: 4px;” onclick=“if(typeof jsfcljs == ‘function’){jsfcljs(document.getElementById(‘header:header_info’),{‘header:header_info:linklogout’:‘header:header_info:linklogout’},‘’);}return false” href=“#”>Logout