Open asmithgt opened 3 years ago
Thanks for raising this @asmithgt .
This module does actually use Disable-ScheduledTask
. See https://github.com/dsccommunity/ComputerManagementDsc/blob/master/source/DSCResources/DSC_ScheduledTask/DSC_ScheduledTask.psm1#L460
We do see the message Disabling existing scheduled task 'Scheduled Start' in '\Microsoft\Windows\WindowsUpdate'.
in the logs you shared, so that would indicate that code is running.
I do notice that there appears to be a missing '\' at the end of the path shown in the logs. The DSC config you shared did include the '\'. This might be nothing but worth checking.
Details of the scenario you tried and the problem that is occurring
Following the example in the documentation for disabling a built-in task I am receiving the error message that "The parameter is incorrect." at the 'Disabling' step. See below for more details:
Verbose logs showing the problem
Suggested solution to the issue
Review/Debug and correct what may be causing this error. In general it seems that the module is using the "Register-ScheduledTask" cmdlet, but perhaps in the case of disabling an exisiting task, the Set-TargetResource method should be using "Disable-ScheudledTask" instead?
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
OsName : Microsoft Windows 10 Enterprise for Virtual Desktops OsOperatingSystemSKU : 175 OsArchitecture : 64-bit WindowsVersion : 2009 WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406 OsLanguage : en-US OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
Name Value
PSVersion 5.1.19041.610 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.610 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
Version of the DSC module that was used ('dev' if using current dev branch)
master - whatever is on PSGallery