OK so upon testing I have noticed a few things.
1. When I run script from function I don't see it open the IE window and step thru pages and clicks. I have no way validating whats happens. I only get IE browser but its blank I see no movement.
2. I am finding it kinda odd that I am not getting any -200 errors.
3. In the function file why is the IE object created outside function. When you call function that code does not run correct?
4. When I run script once works fine. once done and run the second time I get this error.
If I shutdown PowershellISE and start it again works fine. Does it have something to do with the fact I closed the IE Window that was open by the session on first go round.