diff --git a/lib/ansible/modules/windows/win_lineinfile.ps1 b/lib/ansible/modules/windows/win_lineinfile.ps1 index a155acc4e61..134bee385a4 100644 --- a/lib/ansible/modules/windows/win_lineinfile.ps1 +++ b/lib/ansible/modules/windows/win_lineinfile.ps1 @@ -421,7 +421,7 @@ If ($state -eq "present") { } If ($insertbefore -and $insertafter) { - Add-Warning('Both insertbefore and insertafter parameters found, ignoring "insertafter=$insertafter"'); + Add-Warning $result "Both insertbefore and insertafter parameters found, ignoring `"insertafter=$insertafter`"" } If (-not $insertbefore -and -not $insertafter) { diff --git a/lib/ansible/modules/windows/win_regedit.ps1 b/lib/ansible/modules/windows/win_regedit.ps1 index 6659aa474f0..e558ad0e3a5 100644 --- a/lib/ansible/modules/windows/win_regedit.ps1 +++ b/lib/ansible/modules/windows/win_regedit.ps1 @@ -45,7 +45,7 @@ if ($diff_support) { # Fix HCCC:\ PSDrive for pre-2.3 compatibility if ($path -match "^HCCC:\\") { - Add-Warning("Please use path: HKCC:\... instead of path: $path") + Add-Warning $result "Please use path: HKCC:\... instead of path: $path" $path = $path -replace "HCCC:\\","HKCC:\\" }