mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-06 08:34:49 +02: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
|
new-zipfile.ps1, Creates a new .zip file from a directory
|
||||||
reboot.ps1, Reboots the local computer (needs admin rights)
|
reboot.ps1, Reboots the local computer (needs admin rights)
|
||||||
reboot-fritzbox.ps1, Reboots the FRITZ!box device
|
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-empty-dirs.ps1, Removes empty subfolders within the given directory tree
|
||||||
remove-print-jobs.ps1, Removes all jobs from all printers
|
remove-print-jobs.ps1, Removes all jobs from all printers
|
||||||
remove-tag.ps1, Removes a tag in a Git repository
|
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-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-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) |
|
| [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) |
|
| [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-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) |
|
| [take-screenshots.ps1](Scripts/take-screenshots.ps1) | Takes multiple screenshots (every minute by default) | [Help](Docs/take-screenshots.md) |
|
||||||
|
@ -2,10 +2,13 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
remind-me.ps1
|
remind-me.ps1
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Creates a scheduled task that will display a message.
|
Creates a scheduled task that will display a popup message.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./remind-me "Dentist" "1/1/2016 12:00 PM"
|
PS> ./remind-me "Dentist" "4/10/2021 12:00 PM"
|
||||||
✔ OK
|
|
||||||
|
TaskPath TaskName State
|
||||||
|
-------- -------- -----
|
||||||
|
\ Reminder_451733811 Ready
|
||||||
.NOTES
|
.NOTES
|
||||||
Author: Markus Fleschutz · License: CC0
|
Author: Markus Fleschutz · License: CC0
|
||||||
.LINK
|
.LINK
|
||||||
@ -17,13 +20,12 @@
|
|||||||
param([string]$Message = "", [datetime]$Time)
|
param([string]$Message = "", [datetime]$Time)
|
||||||
|
|
||||||
try {
|
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"
|
$Task = New-ScheduledTaskAction -Execute msg -Argument "* $Message"
|
||||||
$Trigger = New-ScheduledTaskTrigger -Once -At $Time
|
$Trigger = New-ScheduledTaskTrigger -Once -At $Time
|
||||||
$Random = (Get-Random)
|
$Random = (Get-Random)
|
||||||
Register-ScheduledTask -Action $Task -Trigger $Trigger -TaskName "Reminder_$Random" -Description "Reminder"
|
Register-ScheduledTask -Action $Task -Trigger $Trigger -TaskName "Reminder_$Random" -Description "Reminder"
|
||||||
"✔️ OK"
|
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user