Might have something to do with the pipe? According to the docs, the windows provider directly executes the binary. The pipe might be a function of the shell... You might try using the alternate syntax they suggest and execute your command through cmd.exe.
http://docs.puppetlabs.com/references/latest/type.html#exec-providers On Thursday, October 3, 2013 8:04:17 AM UTC-7, Armindo Silva wrote: > > Hi > > I am installing the OpenVPN's certificate if it is not present with the > following exec: > > > exec { 'OvpnCert': > command => 'certutil.exe -addstore TrustedPublisher > c:\installers\OpenVPN_Cert.cer', > require => File[ 'c:/eufinity/installers/'], > unless => 'certutil.exe -verifystore TrustedPublisher | findstr > OpenVPN', > } > > Even when *certutil.exe -verifystore TrustedPublisher | findstr > OpenVPN*returns 0 ( > *echo %errorlevel%* after running the unless cmd: returns *0* when the > OpenVPN is present and *1* otherwise), the exec always runs. > What am I doing wrong? > > Thank you. > Armindo > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.