PowerShell | Scheduled Task Template
Simple one today.
Just a quick template on scheduled tasks. Just copy and paste to your script. Super fun happy times
$NewScheduledTaskAction = New-ScheduledTaskAction -Execute “PowerShell.exe” -Argument “-ExecutionPolicy Bypass C:\scripts\test.ps1”
$NewScheduledTaskTrigger = New-ScheduledTaskTrigger -Daily -At ‘3AM’
$NewScheduledTask = New-ScheduledTask -Action $NewScheduledTaskAction -Trigger $NewScheduledTaskTrigger
$NewScheduledTask | Register-ScheduledTask -TaskName “Script” -User “Luke” -Password “SuperSecurePassword”
|