mwrock / packer-templates

Templates for creating vagrant boxes
Other
536 stars 250 forks source link

Chef client not removed #110

Open rjhornsby opened 6 years ago

rjhornsby commented 6 years ago

I think maybe for newer chef clients, there's no .msi file left behind to run that will allow you to uninstall the chef client in scripts/cleanup.ps1. I added the following bit below the existing uninstall attempt and it seems to have resolved the issue:

# Modern chef clients should be uninstalled through 'Add/Remove Programs'
$chef = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match "Chef" }
if ($chef) {
  $chef.uninstall()
}