Skip to content

Latest commit

 

History

History
142 lines (104 loc) · 3.59 KB

MsgBox.md

File metadata and controls

142 lines (104 loc) · 3.59 KB

Logo

Table of Contents
  1. Description
  2. The Function
  3. Examples
  4. Contact
  5. Acknowledgments

MsgBox

Python
YouTube Tutorial

Description

This function will make a generic pop up message box

The Function

[MsgBox]

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)

}

(back to top)

Examples

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.

(back to top)

Contact

📱 My Socials 📱

C#
YouTube
Python
Twitter
Golang
Instagram
Jsonnet
Discord

(back to top)

Acknowledgments


HOME-PAGE

(back to top)