PowerShell/Scripts/list-tasks.ps1
2021-10-15 23:09:08 +02:00

27 lines
762 B
PowerShell
Executable File

<#
.SYNOPSIS
Lists all Windows scheduler tasks
.DESCRIPTION
This script lists all Windows scheduler tasks.
.EXAMPLE
PS> ./list-tasks
TaskPath TaskName State
-------- -------- -----
\Microsoft\Windows\.NET Framework\ .NET Framework NGEN v4.0.30319 Ready
\Microsoft\Windows\.NET Framework\ .NET Framework NGEN v4.0.30319 64 Ready
...
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
try {
Get-ScheduledTask
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}