Empty string when setup / collecting facter facts #72731
Labels
affects_2.10
This issue/PR affects Ansible v2.10
bot_closed
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
system
System category
SUMMARY
ansible windows -m setup -a 'filter=env*'
[WARNING]: Error when collecting facter facts: Join-Path : Cannot bind argument to parameter 'Path' because it is an
empty string. At line:4 char:47 + $facterPath = Join-Path -Path $_ -ChildPath facter.ex ... +
~~ + CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException +
FullyQualifiedErrorId :
ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand at
, : line 4 at , : line 3
This is the code which causes the warning:
At line:4 char:47 is $_
Should we check empty string first?
ISSUE TYPE
COMPONENT NAME
ansible/windows/plugins/modules/setup.ps1
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible Server:
centos-release-7-9.2009.0.el7.centos.x86_64
Windows Host:
OS: Microsoft Windows 10 Pro
Version: Version 10.0.19041.630
PowerShell Version: 5.1.19041.610
.NET Version: 4.8.04084
STEPS TO REPRODUCE
ansible windows -m setup -a 'filter=env*'
EXPECTED RESULTS
ACTUAL RESULTS
[WARNING]: Error when collecting facter facts: Join-Path : Cannot bind argument to parameter 'Path' because it is an
empty string. At line:4 char:47 + $facterPath = Join-Path -Path $_ -ChildPath facter.ex ... +
~~ + CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException +
FullyQualifiedErrorId :
ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand at
, : line 4 at , : line 3
The text was updated successfully, but these errors were encountered: