Fix PowerShell null-coalescing usage for Ansible EE

This commit is contained in:
2025-10-12 16:04:45 -06:00
parent 1e9912efd2
commit 0eb20d415c

View File

@@ -524,7 +524,11 @@ function Ensure-AnsibleExecutionEnvironment {
$existingPython = $pythonCandidates | Where-Object { Test-Path $_ -PathType Leaf } | Select-Object -First 1
$expectedVersionNorm = ($ExpectedVersion ?? '1.0.0').Trim()
$expectedVersionNorm = $ExpectedVersion
if ([string]::IsNullOrWhiteSpace($expectedVersionNorm)) {
$expectedVersionNorm = '1.0.0'
}
$expectedVersionNorm = $expectedVersionNorm.Trim()
$isUpToDate = $false
if ($existingPython -and $currentVersion -and ($currentVersion -eq $expectedVersionNorm)) {
if (-not $requirementsHash -or ($currentHash -and $currentHash -eq $requirementsHash)) {