I have a script used to send mails via Microsoft Outlook from command prompt. This works fine if I run it from inside PowerShell or ISE console. But when I tried to execute
I had the same issue, I figured out it was a combination of 3 things.