Hi Jim,

On Thu, Oct 11, 2012 at 6:52 AM, jim <stra...@gmail.com> wrote:
> Hello Puppet Users
>
> Can some one please help me, as i'm new to puppet and its syntax.
>
> I want to run an exec
>
>                 exec { "PowerShell_Install":
>                 command         =>
> "C:/Install/WindowsServer2003-KB968930-x86-ENG.exe /quiet",
>
> but only if this file DOESN'T exist
> "C:/WINDOWS/system32/WindowsPowerShell/v1.0/powershell.exe"
>
> Regards
>
> Jim
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/jTWLC6Vz4FQJ.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

You'll want to use the `creates` parameter so that the exec will only
run if that file doesn't exist. See
http://docs.puppetlabs.com/references/latest/type.html#exec

Since that path is in the windows system directory, be careful of
Windows filesystem redirection. You may need to specify the path as
`c:/windows/sysnative/...` See
http://docs.puppetlabs.com/windows/running.html#file-system-redirection-in-64-bit-windows-versions

Josh

-- 
Josh Cooper
Developer, Puppet Labs

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to