From 9be30f2eca631d74905ff124b4a9f5521138bac2 Mon Sep 17 00:00:00 2001 From: Angus Williams Date: Mon, 6 Mar 2017 12:55:42 +0000 Subject: [PATCH] Fixes idempotency issue when upgrading chocolatey packages (#21476) --- lib/ansible/modules/windows/win_chocolatey.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/windows/win_chocolatey.ps1 b/lib/ansible/modules/windows/win_chocolatey.ps1 index 4a44097365..34e2840d63 100644 --- a/lib/ansible/modules/windows/win_chocolatey.ps1 +++ b/lib/ansible/modules/windows/win_chocolatey.ps1 @@ -198,7 +198,7 @@ Function Choco-Upgrade $cmd += " --execution-timeout=$executiontimeout" } - $results = invoke-expression $cmd + $output = invoke-expression $cmd $result.rc = $LastExitCode if ($LastExitCode -notin $successexitcodes) @@ -208,7 +208,7 @@ Function Choco-Upgrade Throw "Error installing $package" } - if ("$output" -match ' upgraded (\d+)/\d+ package\(s\)\. ') + if ("$output" -match ' upgraded (\d+)/\d+ package') { if ($matches[1] -gt 0) {