The trick appears to be that you need to copy the repetition from another trigger.
I noticed that the -AtLogOn would cause it to be executed at the logon of any user, but the runas was set to the author of the task, so it would fail.
To create the task when the author of the task logs in, use this. (If you're in a domain, you might also need to include that name.)
unregister-scheduledtask -TaskName "Test02" -confirm:$false
$ac = New-ScheduledTaskAction -Execute "cmd.exe" -Argument "/c timeout.exe /t 5"
$tr = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
$tr.Repetition = (New-ScheduledTaskTrigger -once -at "12am" -RepetitionInterval (New-TimeSpan -Minutes 1) -RepetitionDuration (New-TimeSpan -Minutes 3)).repetition
Register-ScheduledTask -TaskName "Test02" -Trigger $tr -Action $ac
To run the task at the logon of any user, use this.
unregister-scheduledtask -TaskName "Test02" -confirm:$false -ErrorAction SilentlyContinue
$ac = New-ScheduledTaskAction -Execute "cmd.exe" -Argument "/c timeout.exe /t 5"
$tr = New-ScheduledTaskTrigger -AtLogOn
$pr = New-ScheduledTaskPrincipal -Groupid "INTERACTIVE"
$tr.Repetition = (New-ScheduledTaskTrigger -once -at "12am" -RepetitionInterval (New-TimeSpan -Minutes 1) -RepetitionDuration (New-TimeSpan -Minutes 3)).repetition
Register-ScheduledTask -TaskName "Test02" -Trigger $tr -Action $ac -Principal $pr