diff --git a/scripts/show-notification.ps1 b/scripts/show-notification.ps1 index 12b6e9a0..e8697ade 100755 --- a/scripts/show-notification.ps1 +++ b/scripts/show-notification.ps1 @@ -3,15 +3,21 @@ Shows a notification .DESCRIPTION This PowerShell script shows a toast-message notification for the Windows 10 Notification Center. +.PARAMETER text + Specifies the text to show ('Hello World' by default) +.PARAMETER title + Specifies the title to show ('NOTE' by default) +.PARAMETER duration + Specifies the view duration in milliseconds (5000 by default) .EXAMPLE - PS> ./show-notification "Hello World" + PS> ./show-notification .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$Text = "Hello World", [string]$Title = "NOTE", [int]$Duration = 5000) +param([string]$text = "Hello World", [string]$title = "NOTE", [int]$Duration = 5000) try { Add-Type -AssemblyName System.Windows.Forms @@ -19,8 +25,8 @@ try { $path = (Get-Process -id $pid).Path $balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) $balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Info - $balloon.BalloonTipText = $Text - $balloon.BalloonTipTitle = $Title + $balloon.BalloonTipText = $text + $balloon.BalloonTipTitle = $title $balloon.Visible = $true $balloon.ShowBalloonTip($Duration) exit 0 # success