Skip to content

Conversation

@mvarian
Copy link
Contributor

@mvarian mvarian commented Sep 12, 2025

Fix issue where uncaught powershell exception and error message was occurring if a task didn't exist, improve to handle disabling multiple instances of the same task.

Example of prior output:

[VDI Optimize] Disable Scheduled Tasks
Get-ScheduledTask : No MSFT_ScheduledTask objects found with property 'TaskName' equal to 'Restore'. Verify the value
of the property and retry.
At C:\ProgramData\NorthSky\VDOT\vdot-package\Windows_VDOT.ps1:276 char:35

  • ... $TaskObject = Get-ScheduledTask $Item.ScheduledTask
  •                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Restore:String) [Get-ScheduledTask], CimJobException
    • FullyQualifiedErrorId : CmdletizationQuery_NotFound_TaskName,Get-ScheduledTask

…ccurring if a task didn't exist, improve to handle disabling multiple instances of the same task
@tmmuessig
Copy link
Contributor

@mvarian - I have not forgotten about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants