Closed guitarrapc closed 8 years ago
ref : https://github.com/guitarrapc/DSCResources/issues/49#issuecomment-178571072
If you set cScheduledTask as below it works fine.
configuration present { Import-DscResource -Modulename GraniResource Node $AllNodes.Where{$_.Role -eq "localhost"}.NodeName { cScheduleTask hoge { Ensure = "Present" Execute = "C:\Temp\test.bat" TaskName = "TestRenaud2123" TaskPath = "\rimes" ScheduledAt = [datetime]"00:00:00", [datetime]"01:00:00" RepetitionIntervalTimeSpanString = @(([TimeSpan]"00:05:00").ToString()) RepetitionDurationTimeSpanString = @(([TimeSpan]::MaxValue).ToString()) Disable = $false } } }
But if you set TaskPath without \ on first char, Test always fail and start Set.
\
configuration present { Import-DscResource -Modulename GraniResource Node $AllNodes.Where{$_.Role -eq "localhost"}.NodeName { cScheduleTask hoge { Ensure = "Present" Execute = "C:\Temp\test.bat" TaskName = "TestRenaud2123" TaskPath = "rimes" ScheduledAt = [datetime]"00:00:00", [datetime]"01:00:00" RepetitionIntervalTimeSpanString = @(([TimeSpan]"00:05:00").ToString()) RepetitionDurationTimeSpanString = @(([TimeSpan]::MaxValue).ToString()) Disable = $false } } }
TaskPath
Hi @renaudl,
I have released new version 3.7.6. You can find it at PowerShell Gallery. Appreciate for your feed back.
Cheers,
Reference
ref : https://github.com/guitarrapc/DSCResources/issues/49#issuecomment-178571072
Description
If you set cScheduledTask as below it works fine.
But if you set TaskPath without
\
on first char, Test always fail and start Set.Todo
TaskPath
first char for\
\
if there isn't exists.