Skip to content

Instantly share code, notes, and snippets.

@59uptime
Created November 15, 2018 17:15
Show Gist options
  • Save 59uptime/d646afcd06bf53979e6394e708042398 to your computer and use it in GitHub Desktop.
Save 59uptime/d646afcd06bf53979e6394e708042398 to your computer and use it in GitHub Desktop.
Example of code
$action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument ' -command "& {shutdown -s}"'
$trigger = New-ScheduledTaskTrigger -Daily -At 4:24pm
register-ScheduledTask -Action $action -Trigger $trigger -TaskName "shutdown" -Description "Shutdown computer at specific time" -user "system" -force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment