Hi guys! I am in need of some help and before posting my code, I am not a PS coder, I am able to understand the code well, but most of it is AI generated, tested and after adjusted to my needs. I use NSSM to run a Batch file as a service that starts a PowerShell file that at some point is going to display a message box, however since it's being started from a no UI window, the message box pretty much never displayed. I got it to work after some time, but currently I have a problem that when it's ran as a service, half of the message box's content just get's straight up cut off.
The msgbox content is like A threat was found in {filename} (PID: {pid}) accesing unknow and then it doesn't print any of the other stuff that it's supposed to. The second line and reminder are totally skipped. Any ideas how to fix this issue? Thanks!