New-TrayNotify.ps1
<#PSScriptInfo .VERSION 1.0.0 .GUID c76e20c6-aa94-4c7a-a846-659804422c59 .AUTHOR Jimmy Briggs .COMPANYNAME jimbrig .COPYRIGHT Jimmy Briggs | 2023 .TAGS Windows Taskbar Notification System Form .LICENSEURI https://github.com/jimbrig/PSScripts/blob/main/LICENSE .PROJECTURI https://github.com/jimbrig/PSScripts/New-TrayNotify/ .ICONURI .EXTERNALMODULEDEPENDENCIES .REQUIREDSCRIPTS .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES Initial Release .PRIVATEDATA #> <# .SYNOPSIS Display a balloon tip message in the system tray. .DESCRIPTION Displays a user-defined message as a balloon popup in the system tray. .NOTES This function requires Windows Vista or later. .PARAMETER Title Title of the balloon tip. .PARAMETER Message Message to display in the balloon tip. .PARAMETER MessageType (Optional) Type of message to display in the balloon tip. Valid values are: Info, Warning, Error, or None. Defaults to Info. .PARAMETER SysTrayIconPath (Optional) Path to the icon to display as the system tray icon. Defaults to the current process executable's icon (i.e. pwsh.exe). .PARAMETER Timeout (Optional) Time in milliseconds to display the balloon tip. Defaults to 5 seconds (5,000 milliseconds). .EXAMPLE New-TrayNotify -Title 'Hello World' -Message 'This is a test message.' # Displays a balloon tip with the title 'Hello World' and the message 'This is a test message.' for 5 seconds. .EXAMPLE New-TrayNotify -Title 'Hello World' -Message 'This is a test message.' -MessageType Warning -Timeout 10000 # Displays a balloon tip with the title 'Hello World' and the message 'This is a test message.' for 10 seconds. .EXAMPLE New-TrayNotify New-DISMReport -ReportPath 'C:\Users\Public\DISMReport.txt' -Background # Displays a balloon tip with the title 'Hello World' and the message 'This is a test message.' for 10 seconds. #> Param() # SIG # Begin signature block # MIIbsQYJKoZIhvcNAQcCoIIbojCCG54CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGS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