Closed silversword411 closed 4 months ago
Doesnt work for me, changed afew things but not passing $Wait correctly
A 120 second wait on a 90 second killed script definitely won't work 😂
Probably need to update timeout to 12hrs or something crazy or agent is going to kill it while ps is waiting.
changed timeout to 300 seconds and wait to 120 seconds and still get the same
ChatGPT failed me... -wait
on Restart-Computer
also requires other flags.
Let's just ps sleep x
and then run it....with an expanded script timeout.
Actually tested this time.
Id just do it
param(
[int]$Wait
)
if ($Wait) {
shutdown -r -t $Wait
}
else {
Restart-Computer -Force
}
Id just do it
Works for me! :)
Please merge if this looks good thx!