Use Test-PuppetInstalledVersion instead of Test-PuppetInstalled #585
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into an issue with Bolt running "puppet_agent::install" where we had uninstalled the Puppet Agent on a Win10 machine and Bolt would not install the agent again. The message was
Version parameter not defined and agent detected. Nothing to do.
When the Puppet Agent is uninstalled, the registry keys (at least on the two Windows machines I've tested) are left in place. I believe the
Test-PuppetInstalled
method is a little lacking and should do further testing to check whether Puppet is installed or not. Similar to what the existingTest-PuppetInstalledVersion
already does, which only has a boolean result.I'm looking for suggestions related to this topic, because I can see a couple different options to tackle this problem.
I've also noticed there are a couple different places doing similar logic, reading the registry keys and the
VERSION
file. Another refactor might be to pull those pieces up to a "helper".