Showing with 18 additions and 6 deletions.
  1. +8 −0 CHANGELOG.md
  2. +1 −1 metadata.json
  3. +1 −1 tasks/install.json
  4. +1 −2 tasks/install_powershell.json
  5. +7 −2 tasks/install_powershell.ps1
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.0.1] - 2020-01-28

### Summary
Fix `install_powershell` task for Powershell < 3.0.

### Bug fixes
- Fixed `install_powershell` task failure when using Powershell < 3.0 ([MODULES-10514](https://tickets.puppetlabs.com/browse/MODULES-10514))

## [3.0.0] - 2020-01-24

### Summary
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-puppet_agent",
"version": "3.0.0",
"version": "3.0.1",
"author": "puppetlabs",
"summary": "Upgrades All-In-One Puppet Agents",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion tasks/install.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
},
"implementations": [
{"name": "install_shell.sh", "requirements": ["shell"], "files": ["facts/tasks/bash.sh"], "input_method": "environment"},
{"name": "install_powershell.ps1", "requirements": ["powershell"], "files": ["puppet_agent/tasks/version_powershell.ps1"]}
{"name": "install_powershell.ps1", "requirements": ["powershell"]}
]
}
3 changes: 1 addition & 2 deletions tasks/install_powershell.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@
"description": "Whether to stop the puppet agent service after install",
"type": "Optional[Boolean]"
}
},
"files": ["puppet_agent/tasks/version_powershell.ps1"]
}
}
9 changes: 7 additions & 2 deletions tasks/install_powershell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ catch [System.Management.Automation.CommandNotFoundException] {
}

function Test-PuppetInstalled {
$result = & "$PSScriptRoot\version_powershell.ps1" | ConvertFrom-Json
return $result.version
$rootPath = 'HKLM:\SOFTWARE\Puppet Labs\Puppet'
try {
if (Get-ItemProperty -Path $rootPath) { RETURN $true }
}
catch {
RETURN $false
}
}

if ($version) {
Expand Down