I still can't get it to work:
Facter::Util::Resolution.exec("C:\\Windows\\System32\\cmd.exe /c
'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe ipconfig |
Select-String -pattern '192.168.20[567]' | %{$_.line.split()} | FINDSTR
192.168.20[567]'")
On Wednesday, October 30, 20
The second issue is that findstr is a shell builtin, so you have wrap the
entire command in:
cmd.exe /c
You may have to quote the original command and adjust the interior quotes
accordingly.
Josh
On Wednesday, October 30, 2013, cko wrote:
> Still no effect.
>
>
> Facter::Util::Resolution.exec
On Tuesday, October 29, 2013, cko wrote:
> Hi everybody,
>
> I'm trying to write a custom fact that gets the IP Address of any given
> NIC if it matches a specific IP range.
>
> On Linux i use this (works fine)
>
> Facter.add("ip_foo") do
>setcode do
> Facter::Util::Resolution.exec("/sbi
Hi everybody,
I'm trying to write a custom fact that gets the IP Address of any given NIC
if it matches a specific IP range.
On Linux i use this (works fine)
Facter.add("ip_foo") do
setcode do
Facter::Util::Resolution.exec("/sbin/ifconfig | /bin/grep
'192.168.20[567].' | /bin/awk '{