Created
September 17, 2014 19:47
-
-
Save guitarrapc/9f314004e66868c14b3a to your computer and use it in GitHub Desktop.
ScheduleTask Configuration : https://github.com/guitarrapc/DSCResources/blob/master/Custom/Test/Grani_cScheduleTask/Present/Daily/cScheduleTask.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configuration present | |
{ | |
Import-DscResource -Modulename GraniResource | |
Node $AllNodes.Where{$_.Role -eq "localhost"}.NodeName | |
{ | |
cScheduleTask hoge | |
{ | |
Ensure = "present" | |
Execute = "powershell.exe" | |
Argument = "-Command 'Get-Date | Out-File c:\hoge.log'" | |
TaskName = "hoge" | |
TaskPath = "\" | |
ScheduledAt = [datetime]"00:00:00" | |
Daily = $true | |
Credential = (get-valentiaCredential) | |
} | |
} | |
} | |
$ConfigurationData = @{ | |
Allnodes = @( | |
@{ | |
NodeName = "*" | |
PSDscAllowPlainTextPassword = $true | |
} | |
@{ | |
NodeName ="localhost" | |
Role = "localhost" | |
} | |
) | |
} | |
present -OutputPath . -ConfigurationData $ConfigurationData | |
Start-DscConfiguration -Wait -Force -Verbose -Path present |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment