Search code examples
powershellpowershell-2.0powershell-3.0powershell-4.0

How to bringtofront a messagebox in Powershell


Just need a little help with a Powershell Script.

I have a last messagebox on my script. what i want to accomplish is bring the messagebox in front of all the windows.

cmdlet that i use is

$end=[system.Windows.Forms.Messagebox]::Show('StartUP Tool Progress Completed!','StartUP Warning')


Solution

  • Alternatively, if all you need is a message box you can use the Wscript Shell:

    $wshell = New-Object -ComObject Wscript.Shell
    $wshell.Popup("StartUP Tool Progress Completed",0,"Completed",0x0)
    

    For more information: Popup Method