Here is the requested information:
Line 1 is comments:
##########################################################################
The 1st non-comment line on line 93 is:
param
I should mention that application being compiled is some 6,900+ lines of code
The compiler info is:
Engine Settings
==============
Platform: SAPIEN PowerShell V3 Host (Command line) x64
STA Mode: not selected
Manifest Creation: Embed a default manifest for elevation
Run Mode: Current user
Execution Restrictions
======================
Windows 8.1, 8 & 7 selected
No build options selected
The compiling machine is Windows 10 with PowerShell 5
The application is run from an elevated prompt and the error occurs when running in a Windows 2012 R2 environment; PowerShell ver 5.0.10586.117
For example I can get it to occur if "Send-MailMessage" has an invalid -From address parsed from an INI file set by the user. e.g. they have "no-reply" instead of "
no-replay@somedomain.co.nz" or using Register-ScheduledTask
If the same application is run uncompiled, it generates the normal warning or error messages and continues running -- compiled it abends with the message mentioned.
I will try to build an EXE with just a few lines of code to see if it still crashes.
Thanks
G