mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-16 23:51:18 +02:00
Updated the Markdown manuals
This commit is contained in:
@ -6,9 +6,10 @@ This PowerShell script shows a toast-message notification for the Windows 10 Not
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
PS> ./show-notification.ps1 [[-Text] <String>] [[-Title] <String>] [[-Duration] <Int32>] [<CommonParameters>]
|
||||
PS> ./show-notification.ps1 [[-text] <String>] [[-title] <String>] [[-Duration] <Int32>] [<CommonParameters>]
|
||||
|
||||
-Text <String>
|
||||
-text <String>
|
||||
Specifies the text to show ('Hello World' by default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
@ -16,7 +17,8 @@ PS> ./show-notification.ps1 [[-Text] <String>] [[-Title] <String>] [[-Duration]
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-Title <String>
|
||||
-title <String>
|
||||
Specifies the title to show ('NOTE' by default)
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
@ -25,6 +27,7 @@ PS> ./show-notification.ps1 [[-Text] <String>] [[-Title] <String>] [[-Duration]
|
||||
Accept wildcard characters? false
|
||||
|
||||
-Duration <Int32>
|
||||
Specifies the view duration in milliseconds (5000 by default)
|
||||
|
||||
Required? false
|
||||
Position? 3
|
||||
@ -40,7 +43,7 @@ PS> ./show-notification.ps1 [[-Text] <String>] [[-Title] <String>] [[-Duration]
|
||||
Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./show-notification "Hello World"
|
||||
PS> ./show-notification
|
||||
|
||||
```
|
||||
|
||||
@ -60,15 +63,21 @@ Script Content
|
||||
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
|
||||
@ -76,8 +85,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
|
||||
@ -87,4 +96,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of show-notification.ps1 as of 03/27/2024 17:36:31)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of show-notification.ps1 as of 05/19/2024 10:25:26)*
|
||||
|
Reference in New Issue
Block a user