Skip to content

Commit 5b7318e

Browse files
committed
Use Test-PuppetInstalledVersion instead of Test-PuppetInstalled
1 parent e24a8c1 commit 5b7318e

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

tasks/install_powershell.ps1

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ catch [System.Management.Automation.CommandNotFoundException] {
2626
}
2727
}
2828

29-
function Test-PuppetInstalled {
30-
$rootPath = 'HKLM:\SOFTWARE\Puppet Labs\Puppet'
31-
try {
32-
if (Get-ItemProperty -Path $rootPath) { RETURN $true }
33-
}
34-
catch {
35-
RETURN $false
36-
}
37-
}
38-
3929
function Test-PuppetInstalledVersion {
4030
$rootPath = 'HKLM:\SOFTWARE\Puppet Labs\Puppet'
4131

@@ -82,7 +72,7 @@ if ($version) {
8272
}
8373
}
8474
else {
85-
if (Test-PuppetInstalled) {
75+
if (Test-PuppetInstalledVersion) {
8676
Write-Output "Version parameter not defined and agent detected. Nothing to do."
8777
Exit
8878
}
@@ -160,5 +150,5 @@ if($_noop -eq 'true') {
160150
DownloadPuppet
161151
InstallPuppet
162152
Cleanup
163-
Write-Output "Puppet Agent installed on $env:COMPUTERNAME"
153+
Write-Output "Puppet Agent installed on $env:COMPUTERNAME"
164154
}

0 commit comments

Comments
 (0)