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.
Would appreciate if anyone has any insights on this or was able to find a workaround.
Thank you!
CodePudding user response:
As I alluded to in the comments, this can be solved by:
- Fetching the existing task instance
- Modifying the description on the existing instance
- 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