Table of Contents
This function will make a generic pop up message box
The title, button, and image parameters are optional.
You can use tab completion on the button and image parameter
Generate a Message Box pop up using the following syntax:
MsgBox -message 'this is the message body' -title "this is the title" -button OKCancel -image Warning
or
MsgBox -m 'this is the message body' -t "this is the title" -b OKCancel -i Warning
function MsgBox {
[CmdletBinding()]
param (
[Parameter (Mandatory = $True)]
[Alias("m")]
[string]$message,
[Parameter (Mandatory = $False)]
[Alias("t")]
[string]$title,
[Parameter (Mandatory = $False)]
[Alias("b")]
[ValidateSet('OK','OKCancel','YesNoCancel','YesNo')]
[string]$button,
[Parameter (Mandatory = $False)]
[Alias("i")]
[ValidateSet('None','Hand','Question','Warning','Asterisk')]
[string]$image
)
Add-Type -AssemblyName PresentationCore,PresentationFramework
if (!$title) {$title = " "}
if (!$button) {$button = "OK"}
if (!$image) {$image = "None"}
[System.Windows.MessageBox]::Show($message,$title,$button,$image)
}
Listed below are payloads that have used one of these functions:
None currently. Please feel free to submit a pull request and edit this line linking one of your payloads that have used this function.