joefitzgerald / packer-windows

Windows Packer Templates
MIT License
1.63k stars 1.12k forks source link

Fix syntax that prevents update discovery #164

Closed senglin closed 9 years ago

senglin commented 9 years ago

The Count and other properties of the items were not accessible if there is only 1 item in the array. This fix ensures that all properties can be read.

I wondered why a single important update wasn't installing using the script but was easily installed manually. Using the Powershell debugger, it was discovered that the properties do not actually exist.

This was tested and discovered in Windows Server 2012 R2. This results in a longer update time, which proves that there are now more updates being installed.

StefanScherer commented 9 years ago

Works fine, I've tested with with a Windows 10 box.

kensykora commented 9 years ago

:+1: