Get-ScheduledTask -TaskName no longer works on my Win10

proj964 21 Reputation points
2021-06-14T18:32:00.45+00:00

Windows 10 Pro, 20H2, 19042.985

PowerShell Commandlet Get-ScheduledTask -TaskName no longer accepts the 'TaskName' parameter.

It does have a -Name <Object>

However, lines like

Get-ScheduledTask -Name "Proxy"

return nothing. Hoping someone knows how to make this work again.

The command help for -Name is:

-Name <Object>
The name or name pattern of the scheduled task

Required? false
Position? 1
Default value *
Accept pipeline input? false
Accept wildcard characters? false

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,596 questions
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 33,736 Reputation points
    2021-06-15T02:36:23.423+00:00

    how do I find it?

    Since your source is task scheduler, try this.

    ($env:PSModulePath -split ';' | get-childitem -recurse |  where-object -property fullname -match TaskScheduler).fullname
    

    My source is "scheduledtasks",so I get this:

    PS C:\> ($env:PSModulePath -split ';' | get-childitem -recurse |  where-object -property fullname -match scheduledtasks).fullname
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\en-US
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\MSFT_ScheduledTask.format.ps1xml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\MSFT_ScheduledTask.types.ps1xml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\MSFT_ScheduledTask_v1.0.cdxml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\PS_ClusteredScheduledTask_v1.0.cdxml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\PS_ScheduledTask.types.ps1xml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\PS_ScheduledTask_v1.0.cdxml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\ScheduledTasks.psd1
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\ScheduledTasks_5378ee8e-e349-49bb-83b9-f3d9c396c0a6_HelpInfo.xml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\en-US\MSFT_ScheduledTask_v1.0.cdxml-help.xml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\en-US\PSScheduledJob.dll-help.xml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\en-US\PSScheduledJobPrxy.psm1-help.xml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\en-US\PS_ClusteredScheduledTask_v1.0.cdxml-help.xml
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ScheduledTasks\en-US\PS_ScheduledTask_v1.0.cdxml-help.xml
    PS C:\>
    

    Might be something you loaded in your Documents subfolder.

    PS C:\> $env:PSModulePath -split ';'
    C:\Users\Dave\Documents\WindowsPowerShell\Modules
    C:\Program Files\WindowsPowerShell\Modules
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
    C:\Program Files\Microsoft Message Analyzer\PowerShell\
    

2 additional answers

Sort by: Most helpful
  1. Michael Taylor 54,321 Reputation points
    2021-06-14T19:51:35.713+00:00

    Get-ScheduledTask uses TaskName for the parameter, not Name. This hasn't changed and is working fine on my 21H1 version.

    One theory I have is that you have installed a module that has its own Get-ScheduledTask commandlet that is replacing the existing one. The core command comes from the ScheduledTasks module which installs by default as part of Powershell 5.1 and Powershell Core 7.x. The versions I have are 1.0.0.0 because it hasn't been updated.


  2. Vicky Wang 2,731 Reputation points
    2021-06-16T09:51:57.99+00:00

    Hi,
    I am glad to hear that your issue was successfully resolved. If there is anything else we can do for you, please feel free to post in the forum.
    Best Regards,
    Vicky

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.