- 12,028
- Australia
- I_Grayson_Fox_I
I have a small script for a work computer and I would like to add a command that is run at a specific time.
Since this is a work computer, I cant use Task Scheduler due to permissions.
Found this script that can restart the computer at 8PM.
[datetime]$RestartTime = '8PM'
[datetime]$CurrentTime = Get-Date
[int]$WaitSeconds = ( $RestartTime - $CurrentTime ).TotalSeconds
shutdown -r -t $WaitSeconds
Anyone to tweak this script to run any command?
Since this is a work computer, I cant use Task Scheduler due to permissions.
Found this script that can restart the computer at 8PM.
[datetime]$RestartTime = '8PM'
[datetime]$CurrentTime = Get-Date
[int]$WaitSeconds = ( $RestartTime - $CurrentTime ).TotalSeconds
shutdown -r -t $WaitSeconds
Anyone to tweak this script to run any command?