Browse Source

Merge pull request #69 from austinmroczek/patch-1

create scheduled task for upgrades
pull/70/head
Alex Hirsch 8 years ago
committed by GitHub
parent
commit
2870a3fc98
  1. 8
      utils/install-basic-software.ps1

8
utils/install-basic-software.ps1

@ -32,6 +32,14 @@ $packages = @(
echo "Setting up Chocolatey software package manager" echo "Setting up Chocolatey software package manager"
Get-PackageProvider -Name chocolatey -Force Get-PackageProvider -Name chocolatey -Force
echo "Creating daily task to automatically upgrade Chocolatey packages"
# adapted from https://blogs.technet.microsoft.com/heyscriptingguy/2013/11/23/using-scheduled-tasks-and-scheduled-jobs-in-powershell/
$taskName = "Chocolatey Daily Upgrade"
$taskAction = New-ScheduledTaskAction Execute C:\programdata\chocolatey\choco.exe -Argument "upgrade all -y"
$taskTrigger = New-ScheduledTaskTrigger -At 2am -Daily
$taskUser = "Admin"
Register-ScheduledTask TaskName $taskName -Action $taskAction Trigger $taskTrigger -User $taskUser
echo "Installing Packages" echo "Installing Packages"
Install-Package -Name $packages -Force -ProviderName chocolatey Install-Package -Name $packages -Force -ProviderName chocolatey

Loading…
Cancel
Save