Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created September 17, 2014 19:47
Show Gist options
  • Save guitarrapc/9f314004e66868c14b3a to your computer and use it in GitHub Desktop.
Save guitarrapc/9f314004e66868c14b3a to your computer and use it in GitHub Desktop.
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