Skip to content

Instantly share code, notes, and snippets.

@jalons
Created January 26, 2015 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalons/62577acb88d54fdb64b4 to your computer and use it in GitHub Desktop.
Save jalons/62577acb88d54fdb64b4 to your computer and use it in GitHub Desktop.
Restart_windows
###################################################
# #
# This file managed by Salt, do not edit by hand! #
# #
###################################################
$Time = (Get-Date).AddMinutes(5).ToShortTimeString()
$TimeMilitary = Get-Date $Time -Format HH:mm
$TaskName = "Restart salt-minion"
$Task_Sch = "powershell Restart-Service salt-minion"
$Arguments = "/create /ru System /s localhost /tn `"$TaskName`" /tr `"$Task_Sch`" /sc once /st $TimeMilitary /Z /V1 /F"
Start-Process "c:\Windows\system32\schtasks.exe" -ArgumentList $Arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment