mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-22 20:51:17 +01:00
Add description for remind-me.ps1
This commit is contained in:
parent
5a044708c5
commit
97bedecb92
@ -186,6 +186,7 @@ new-tag.ps1, Creates a new tag in a Git repository
|
||||
new-zipfile.ps1, Creates a new .zip file from a directory
|
||||
reboot.ps1, Reboots the local computer (needs admin rights)
|
||||
reboot-fritzbox.ps1, Reboots the FRITZ!box device
|
||||
remind-me.ps1, Creates a scheduled task that will display a popup message
|
||||
remove-empty-dirs.ps1, Removes empty subfolders within the given directory tree
|
||||
remove-print-jobs.ps1, Removes all jobs from all printers
|
||||
remove-tag.ps1, Removes a tag in a Git repository
|
||||
|
Can't render this file because it has a wrong number of fields in line 87.
|
@ -117,6 +117,7 @@ Mega Collection of PowerShell Scripts
|
||||
| [open-netflix.ps1](Scripts/open-netflix.ps1) | Starts the Netflix app | [Help](Docs/open-netflix.md) |
|
||||
| [open-onedrive.ps1](Scripts/open-onedrive.ps1) | Opens the user's OneDrive folder | [Help](Docs/open-onedrive.md) |
|
||||
| [open-recycle-bin.ps1](Scripts/open-recycle-bin.ps1) | Starts the File Explorer with the recycle bin folder | [Help](Docs/open-recycle-bin.md) |
|
||||
| [remind-me.ps1](Scripts/remind-me.ps1) | Creates a scheduled task that will display a popup message | [Help](Docs/remind-me.md) |
|
||||
| [set-wallpaper.ps1](Scripts/set-wallpaper.ps1) | Sets the given image as wallpaper | [Help](Docs/set-wallpaper.md) |
|
||||
| [take-screenshot.ps1](Scripts/take-screenshot.ps1) | Takes a single screenshot | [Help](Docs/take-screenshot.md) |
|
||||
| [take-screenshots.ps1](Scripts/take-screenshots.ps1) | Takes multiple screenshots (every minute by default) | [Help](Docs/take-screenshots.md) |
|
||||
|
@ -2,10 +2,13 @@
|
||||
.SYNOPSIS
|
||||
remind-me.ps1
|
||||
.DESCRIPTION
|
||||
Creates a scheduled task that will display a message.
|
||||
Creates a scheduled task that will display a popup message.
|
||||
.EXAMPLE
|
||||
PS> ./remind-me "Dentist" "1/1/2016 12:00 PM"
|
||||
✔ OK
|
||||
PS> ./remind-me "Dentist" "4/10/2021 12:00 PM"
|
||||
|
||||
TaskPath TaskName State
|
||||
-------- -------- -----
|
||||
\ Reminder_451733811 Ready
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
@ -17,13 +20,12 @@
|
||||
param([string]$Message = "", [datetime]$Time)
|
||||
|
||||
try {
|
||||
if ($Message -eq "") { $Message = read-host "Enter message to display" }
|
||||
if ($Message -eq "") { $Message = read-host "Enter reminder message" }
|
||||
|
||||
$Task = New-ScheduledTaskAction -Execute msg -Argument "* $Message"
|
||||
$Trigger = New-ScheduledTaskTrigger -Once -At $Time
|
||||
$Random = (Get-Random)
|
||||
Register-ScheduledTask -Action $Task -Trigger $Trigger -TaskName "Reminder_$Random" -Description "Reminder"
|
||||
"✔️ OK"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user