-
-
Notifications
You must be signed in to change notification settings - Fork 546
Expand file tree
/
Copy pathlist-tasks.ps1
More file actions
executable file
·25 lines (23 loc) · 737 Bytes
/
list-tasks.ps1
File metadata and controls
executable file
·25 lines (23 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<#
.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: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
exit 1
}