diff --git a/lib/ansible/modules/extras/windows/win_chocolatey.ps1 b/lib/ansible/modules/extras/windows/win_chocolatey.ps1 index 7a3f14aabc3..3bb6a1f0dc0 100644 --- a/lib/ansible/modules/extras/windows/win_chocolatey.ps1 +++ b/lib/ansible/modules/extras/windows/win_chocolatey.ps1 @@ -74,7 +74,7 @@ Function Chocolatey-Install-Upgrade { $script:executable = "choco.exe" - if ((choco --version) -lt '0.9.9') + if ([Version](choco --version) -lt [Version]'0.9.9') { Choco-Upgrade chocolatey }