PS2EXE
PS2EXE copied to clipboard
My script will not run as a PS2EXE
I used the PS2EXE to convert my script to EXE but all it does is flash on the screen when ran. Running the script works fine.
I'm not sure how to debug this PS2EXE process to even begin looking at where the issue is. Doesn't seem to be any relevant documentation on PS2EXE. Thoughts or suggestions?
Add some logging logic to your script to see if and what is running... or post an example of your script...
So I ended up using the ps2exe gui version and made some progress (I'm getting stuff on screen), but unfortunately it's a bunch of errors. After the errors, many of the Write-Host statements I have in the script are displayed as annoying dialog boxes. I haven't gone through your documentation yet but is that expected?
If I use the suppress error option just to see if my form loads (it's a WPF application), I get the first few write-host/dialog boxes as expected but once done, it simply disappears with no form shown. The error in the picture appears to be the attempt to parse the XAML that creates the form so I guess that's why no form is shown. Is PS2EXE not compatible with WPF/XAML forms or something?
Update I just realized the GUI version I'm referencing is a different PS2EXE project from a differ author. My bad.
Stupid question, but why not compiling an EXE directly by using C# and WPF ?