Custom Fact for Firefox Version (Windows)
I'd like to write a custom fact for Windows that holds the current version of Firefox. Using the command line, the version of Firefox can be found by using the command:
C:\"Program Files (x86)\Mozilla Firefox"\firefox.exe -v | more
This command outputs the version of Firefox AND a newline. So for instance it will display...
This is a problem because facter stores my "firefox_version" fact as blank. If any of you Windows command line gurus have a way to remove the new line, I'd love to know it! :) One of the best solutions I've found is to use Powershell to remove the newline using the powershell command:
C:\"Program Files (x86)\Mozilla Firefox"\firefox.exe -v | more | Select -First 1
I've looked at the question here, but it is very confusing on what quotes should be used and how it should be applied in the exec line. Do you guys know how I could use this or maybe some other solution to store the version of Firefox in facter on a Windows machine?