PowerShell/Scripts/list-tasks.ps1
2021-10-04 21:29:23 +02:00

27 lines
731 B
PowerShell
Executable File

<#
.SYNOPSIS
Lists all Windows scheduler tasks
.DESCRIPTION
list-tasks.ps1
.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
}