mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-25 01:14:16 +01:00
26 lines
731 B
PowerShell
Executable File
26 lines
731 B
PowerShell
Executable File
<#
|
|
.SYNOPSIS
|
|
Lists all scheduled tasks
|
|
.DESCRIPTION
|
|
This PowerShell script lists all scheduled tasks.
|
|
.EXAMPLE
|
|
PS> ./list-tasks.ps1
|
|
|
|
TASKNAME TASKPATH STATE
|
|
-------- -------- -----
|
|
.NET Framework NGEN v4.0.30319 \Microsoft\Windows\.NET Framework\ Ready
|
|
...
|
|
.LINK
|
|
https://github.com/fleschutz/PowerShell0
|
|
.NOTES
|
|
Author: Markus Fleschutz | License: CC0
|
|
#>
|
|
|
|
try {
|
|
Get-ScheduledTask | Format-Table -property @{e='TASKNAME';width=40},@{e='TASKPATH';width=55},@{e='STATE';width=10}
|
|
exit 0 # success
|
|
} catch {
|
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
exit 1
|
|
}
|