I'm creating a puppet custom fact using ruby script to output some AD related details. I learned the ServerManager is a prerequisite module as this is not automatically added in the Windows 2008 R2 build yet. I have manually run my powershell commands in one of my 2008 R2 servers and it worked. However, I am getting the following error everytime I run it as a puppet facter.
Appreciate your help on this. Thanks!
Successful Manually run in Windows 2008 R2 server via Powershell
Import-Module ServerManager
Script
if ( $operatingsystemrelease == '2008 R2' )
Facter::Core::Execution.execute(%q[powershell Import-Module ServerManager])
end
Error
error while resolving custom fact "mycustomfact": execution of command "powershell Import-Module ServerManager" failed: command not found.
Source: Facter
Thank you.