Update list-tasks.ps1

This commit is contained in:
Markus Fleschutz 2021-10-20 12:47:58 +02:00
parent ebf16c7ef7
commit c2fc981d4f

View File

@ -1,15 +1,15 @@
<# <#
.SYNOPSIS .SYNOPSIS
Lists all Windows scheduler tasks Lists all scheduled tasks
.DESCRIPTION .DESCRIPTION
This script lists all Windows scheduler tasks. This script lists all scheduled tasks.
.EXAMPLE .EXAMPLE
PS> ./list-tasks PS> ./list-tasks
TaskPath TaskName State TaskName State TaskPath
-------- -------- ----- -------- ----- --------
\Microsoft\Windows\.NET Framework\ .NET Framework NGEN v4.0.30319 Ready .NET Framework NGEN v4.0.30319 Ready \Microsoft\Windows\.NET Framework\
\Microsoft\Windows\.NET Framework\ .NET Framework NGEN v4.0.30319 64 Ready .NET Framework NGEN v4.0.30319 64 Ready \Microsoft\Windows\.NET Framework\
... ...
.NOTES .NOTES
Author: Markus Fleschutz · License: CC0 Author: Markus Fleschutz · License: CC0
@ -18,7 +18,7 @@
#> #>
try { try {
Get-ScheduledTask Get-ScheduledTask | Format-Table -property TaskName,State,TaskPath
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"