Change fact invocation from dotsourcing to ampersand so that scripts do not execute in global scope.
This commit is contained in:
parent
04e9677ae0
commit
a874e1e25e
1 changed files with 1 additions and 1 deletions
|
@ -35,7 +35,7 @@ Function Get-CustomFacts {
|
||||||
$FactsFiles = Get-ChildItem -Path $factpath | Where-Object -FilterScript {($PSItem.PSIsContainer -eq $false) -and ($PSItem.Extension -eq '.ps1')}
|
$FactsFiles = Get-ChildItem -Path $factpath | Where-Object -FilterScript {($PSItem.PSIsContainer -eq $false) -and ($PSItem.Extension -eq '.ps1')}
|
||||||
|
|
||||||
foreach ($FactsFile in $FactsFiles) {
|
foreach ($FactsFile in $FactsFiles) {
|
||||||
$out = . $($FactsFile.FullName)
|
$out = & $($FactsFile.FullName)
|
||||||
Set-Attr $result.ansible_facts "ansible_$(($FactsFile.Name).Split('.')[0])" $out
|
Set-Attr $result.ansible_facts "ansible_$(($FactsFile.Name).Split('.')[0])" $out
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue