diff --git a/tasks/install_powershell.ps1 b/tasks/install_powershell.ps1 index f662ee8d..b69622e7 100644 --- a/tasks/install_powershell.ps1 +++ b/tasks/install_powershell.ps1 @@ -26,16 +26,6 @@ catch [System.Management.Automation.CommandNotFoundException] { } } -function Test-PuppetInstalled { - $rootPath = 'HKLM:\SOFTWARE\Puppet Labs\Puppet' - try { - if (Get-ItemProperty -Path $rootPath) { RETURN $true } - } - catch { - RETURN $false - } -} - function Test-PuppetInstalledVersion { $rootPath = 'HKLM:\SOFTWARE\Puppet Labs\Puppet' @@ -82,7 +72,7 @@ if ($version) { } } else { - if (Test-PuppetInstalled) { + if (Test-PuppetInstalledVersion) { Write-Output "Version parameter not defined and agent detected. Nothing to do." Exit } @@ -160,5 +150,5 @@ if($_noop -eq 'true') { DownloadPuppet InstallPuppet Cleanup - Write-Output "Puppet Agent installed on $env:COMPUTERNAME" + Write-Output "Puppet Agent installed on $env:COMPUTERNAME" }