I'm trying to write a fact for Puppet.
I have an array with usernames array = ["user1", "user2", "user3"]
and then a code
array.each do |item|
temp_data << Facter::Core::Execution.exec("net user #{item} /DOMAIN")
end
search_text = %r{comment|Local}
users_data = []
temp_data.each do |line|
line.each_line do |num|
users_data << (num) unless num =~ search_text
end
end
temp_data generates fine, but I get an error ERROR puppetlabs.facter - error while resolving custom fact "winusers_domain": invalid byte sequence in UTF-8 but it doesn't show witch line the error is. Any suggestion?