0

In my powershell LogOn-Script (for a XenApp-farm) I want to include the option to show a "Message-Box" for the users.

Meaning: The users is starting its application and during the startup he has something to read (Message of the day, security-advices, important annoucements, ...).

Problem: If I call the messagebox with [System.Windows.Forms.MessageBox]::Show(„<<<Announcement<<<“,“Header123“,0)

the script won't continue until the user clicks "Ok".

Idea of solution: I want to call a second powershell-script, which is opening the Message-Box. Unfortunately the calling script (LogOn-script) is wating for the called script to finish (until the user clicks "OK"). Is there a way to get around this...? (I don't want to call a CMD-Script for this...)

Please note, that the intention of the question is to run two scripts in parallel with the idea of one script calling the other script and the calling script should continue runnng, no matter what the called script is doing.

Thank you in advance!

zorro42
  • 25
  • 1
  • 5
  • 1
    https://stackoverflow.com/questions/38851482/how-to-get-a-timer-in-a-powershell-messagebox – David Brabant Nov 02 '17 at 08:15
  • 1
    I do not agree that this is and exact duplicate with [How to get a timer in a Powershell messagebox?](https://stackoverflow.com/questions/38851482/how-to-get-a-timer-in-a-powershell-messagebox). In this this question there is no need for running asynchronous script, the first answer gives some opportunity to do this but will block the script for 1 second every 1012ms. For this question you will need to start a asynchronous job (`Start-Job`) or create a more sophisticated worker like: https://stackoverflow.com/a/40808521/1701026 (I am happy to give an example if some body unblock the question) – iRon Nov 02 '17 at 10:04
  • Thanks @iRon !!! I will try it with the `Start-Job` and let you know! – zorro42 Nov 02 '17 at 10:33
  • @iRon : Thanks! The `Start-Job` does the job for me! That's what I was looking for! – zorro42 Nov 02 '17 at 10:44

0 Answers0