Show-DialogBox & Execute-ProcessAsUser

Hi there, a quick question for you all.

I have an install script that must run silently in System context via SCCM but if an app. is running, it must “break” silence and nag the user to close it. I can only tell if the app. is running by checking if a file is in use. I added a function that does this and I plan to use a custom-written pop-up exe to nag the user, which I will invoke via Execute-ProcessAsUser to the logged-on user.

This works well but I’d prefer PSADT to generate the pop-up rather than having to rely on a separate EXE for GUI consistency reasons. In other words, I want a combination of both the Execute-ProcessAsUser and Show-DialogBox in one! Is what I want possible or have I already got as close as possible with the calling of a separate exe for the nag box?

Cheers in advance for your thoughts.

Execute-ProcessAsUser isnt really meant for code, it used for applications and scripts. You could prepare a ps script that would load toolkit files and then call that function. This script would then be passed as parameter for execute-processasuser. The files would have to be copied to user readable location too.
Overall, this seems like way more work than running an exe. Keep in mind that user has to be able to run scripts.