From a874e1e25e1b897f20d8af85823846888ec80ca0 Mon Sep 17 00:00:00 2001 From: davidobrien1 Date: Fri, 26 Feb 2016 17:09:54 +1100 Subject: [PATCH] Change fact invocation from dotsourcing to ampersand so that scripts do not execute in global scope. --- lib/ansible/modules/windows/setup.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/windows/setup.ps1 b/lib/ansible/modules/windows/setup.ps1 index 08c47553a1..63e5597d86 100644 --- a/lib/ansible/modules/windows/setup.ps1 +++ b/lib/ansible/modules/windows/setup.ps1 @@ -35,7 +35,7 @@ Function Get-CustomFacts { $FactsFiles = Get-ChildItem -Path $factpath | Where-Object -FilterScript {($PSItem.PSIsContainer -eq $false) -and ($PSItem.Extension -eq '.ps1')} foreach ($FactsFile in $FactsFiles) { - $out = . $($FactsFile.FullName) + $out = & $($FactsFile.FullName) Set-Attr $result.ansible_facts "ansible_$(($FactsFile.Name).Split('.')[0])" $out } }