-
-
Save jalons/62577acb88d54fdb64b4 to your computer and use it in GitHub Desktop.
Restart_windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################### | |
# # | |
# 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