Code Editor as popup

Product: PowerShellUniversal
Version: 2.1.2

I have a dashboard that executes a ps1 file when a user clicks on a button. When the script is running, the output is displayed in codeEditor which is located on the dashboard. See Running script on click - #12 by mtndrew11

Is it possible have have a popup window to display the output in codeEditor when the user clicks the button instead of having to keep code editor displayed on the dashboard 100% of the time? This would allow me to clean up the dashboard and not have codeEditor taking up the majority of the space on the dashboard. It would also still provide valuable feedback to the user while the script is running. The goal is as follows:

  1. User Clicks on a button to execute .ps1
  2. A popup window is shown (modal or code editor within a modal??)
  3. The script runs, displaying output in real-time
  4. Script ends with a “press enter to continue” and waits for user’s review of results
  5. User presses enter and the popup window goes away and is directed back to dashboard

Could you take the code in the .ps1 script and make a function on the Dashboard file? Then return the data from the function when the button is clicked. Would look something like this:

  1. User clicks button
  2. UD Button executes pre-defined function and returns data
  3. data is displayed

Let me know if this would work. Happy to provide an example if you need

Thanks @zalcorshark. I believe I see where you are going with the function suggestion. However, I would like to display the script progress in real-time. If I understand your solution correctly, the script would execute in its entirety and then display the results to the end user. Am I understanding that correctly? That might be a workaround if there is no way to display the PowerShell console output in real time in a popup window.

correct, the the way we do it is we execute the function then display the data.

You could use a UD-Toast with a time limit to display the data from the .ps1 function. PSU does not currently offer functionality to have a pop out window for a console app.