Hmm… the code you’ve pasted here shouldn’t be giving that error, unless maybe there’s some unprintable character between the “foreach($Table in $report.Database.Tables)” part and the opening curly brace on the next line. Try highlighting the closing parenthesis and the opening curly brace on the next line, deleting that, and retyping that bit, see if it helps.
I have changed the execution policy to ‘Unrestricted’. By the way, I have updated to Windows 10 and it comes with PowerShell 5.0.
I am also getting errors when I try to login to the website. I used to run this code on a daily basis. No mistakes before. The errors that I am getting for the code below
HRESULT : 0x800A01B6
$ie.Document.getElementById(“js-username”).value= “username”
From what I understand… Internet Explorer has elevated security controls in Windows 10. The solution is to use “IHTMLDocument3_getElementById”, “IHTMLDocument3_getElementsByName” or “IHTMLDocument3_getElementsByTagName” instead. Although these methods aren’t as straight forward when interacting with elements that are linked to Java script…