Search code examples
windowspowershellwindows-task-scheduler

Trying to find ways to update the "Description" parameter of an existing task in Task Scheduler from PowerShell


I am trying to disable a task from Task Scheduler on multiple remote servers and while I do that I want to update the description of these tasks as well.

Though the command sets to work on schedule tasks are pretty straight forward like: Get-Scheduledtask Disable-ScheduledTask Set-ScheduledTask Etc.

I am unable to find parameters or command line that helps modify the Description of an existing task.


Solution

  • As I alluded to in the comments, this can be solved by:

    1. Fetching the existing task instance
    2. Modifying the description on the existing instance
    3. Updating the task
    # fetch existing task object
    $task = Get-ScheduledTask "Pooja's Task"
    
    # update the description
    $task.Description = "New and improved description!"
    
    # persist the change
    $task |Set-ScheduledTask