PowerSHell - MsgBox

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
sergiors
Posts: 3
Joined: Tue Oct 08, 2019 3:11 pm

PowerSHell - MsgBox

Post by sergiors » Sat Oct 12, 2019 6:59 am

Hello,
I need to put a msgbox indicating if the command below was executed successfully or not

$buttonGrant_Click={
#$GroupTest = $textboxCheckGroup.Text
$textboxResultado.Lines = Add-ADGroupMember -Identity $textboxGroup.Text -Members $textboxLogin.Text
}

Example:
If the command execute successfully shows the msg in the popup: 'Access Released'
If the user already has group access, show the msg in the popup: 'User already has group access'
If the command does not execute successfully, displays the msg in the popup: 'Command not executed, check data entered'

Can you help me?
Thank you very much in advance

jvierra
Posts: 14009
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: PowerSHell - MsgBox

Post by jvierra » Sat Oct 12, 2019 9:36 am

[System.Windows.Forms.Form]::Show('this is my message')

Locked