Created
June 24, 2014 12:08
-
-
Save stack72/234571095fb36257052a to your computer and use it in GitHub Desktop.
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 | |
if ( $LASTEXITCODE ) { | |
schtasks /create /TN "puppet upgrade task" /TR "C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -File C:\Windows\Temp\UpgradePuppet.ps1 -version <%= @version %>" /SC Once /ST $startTime /RU SYSTEM | |
} else { | |
$today = (Get-Date -f "MM/dd/yyyy") | |
schtasks /change /TN "puppet upgrade task" /SD $today /ST $startTime /RU SYSTEM | |
} | |
Should change to | |
if ($scheduledTask -eq $true) { | |
$today = (Get-Date -f "MM/dd/yyyy") | |
schtasks /change /TN "puppet upgrade task" /SD $today /ST $startTime /RU SYSTEM | |
} | |
else { | |
schtasks /create /TN "puppet upgrade task" /TR "C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -File C:\Windows\Temp\UpgradePuppet.ps1 -version <%= @version %>" /SC Once /ST $startTime /RU SYSTEM | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
melissabillyiloveyou