voxpupuli / puppet-windowsfeature

Library that uses ServerAdministration api that comes with Windows Server 2008 and Windows Server 2012 to add / remove windows features
https://forge.puppet.com/puppet/windowsfeature
MIT License
30 stars 49 forks source link

(GH-86) Fix invalid XML from Get-WindowsFeature #88

Closed jarretlavallee closed 7 years ago

jarretlavallee commented 7 years ago

Prior to this PR, the ConvertTo-XML return on Windows 2008R2 returned an invalid XML document from Get-WindowsFeature. This commit limits the data selected for the XML return to the data that is parsed. This PR fixes #86 and should only affect Windows 2008R2 and Windows 2008.

BertrandJO commented 7 years ago

Hi, i've read your fix, thanks for the update, this exception should also apply to windows server 2008 (kernel version 6.0), kernel 6.1 stands for 2008R2

win2008 = Facter.value(:kernelmajversion) == '6.1'
# if win2008 import ServerManager module

By default, powershell version is 1.0 on 2008 and 2.0 on 2008 R2

jarretlavallee commented 7 years ago

@BertrandJO Thank you for taking the time to review this. It looks like I had an typo in my PR and commit message as I had only intended to have this on Windows 2008R2. I just pushed a new commit with an additional conditional for Kernel 6.0.

BertrandJO commented 7 years ago

Great ! I will test it tomorrow. Thanks.

BertrandJO commented 7 years ago

Everything works fine