# Usage: alert ( ()) # HELP HANDLE if($args[0] -eq 'h' -or $args[0] -eq '-h' -or $args[0] -eq 'H' -or $args[0] -eq '-H' -or $args[0] -eq 'help' -or $args[0] -eq 'Help' -or $args[0] -eq 'HELP') { Write-Host "Usage: alert ( ())`nalert h/-h/help/etc: Display this help message" exit } # MESSAGE HANDLE DEFAULT if([string]::IsNullOrEmpty($args[0])) { $Message = "Alert" } else { $Message = $args[0] } # TYPE HANDLE DEFAULT if([string]::IsNullOrEmpty($args[1])) { $Type = "Information" } else { $Type = $args[1] } # BUTTONS HANDLE DEFAULT if([string]::IsNullOrEmpty($args[2])) { $Buttons = "OK" } else { $Buttons = $args[2] } # doin inide start-job method so alert box doesnt block Start-Job -ScriptBlock { # get back my fuckin vars inside this script block $Message = $using:Message $Buttons = $using:Buttons $Type = $using:Type # Add the PresentationFramework Add-Type -AssemblyName PresentationFramework # Send the alert [System.Windows.MessageBox]::Show($Message, $Message, $Buttons, $Type) };