Ask Your Question

Executing Git Commands in Windows 2008 R2 using Puppet Scripts

asked 2013-04-09 06:31:01 -0500

dinesh_kumar_logaraj gravatar image

updated 2013-04-09 14:22:18 -0500

llowder gravatar image

Hi, I have been trying to execute git commands in windows using puppet (PE 2.7) scripts. Below are the scripts that I have tried. But the commmands are not getting executed. Any help appreciated on this issue.

$cmd = "C:\Windows\System32\cmd.exe"          
exec {"config-git-name":                 
      command => "$cmd /c git config --global 'DineshLogarajCTS'",   
edit retag flag offensive close merge delete


What output do you get? Can you try adding logoutput => true Also, try changing $cmd to ${cmd} so it will for sure parse properly (this seems to be mangling ...(more)

llowder gravatar imagellowder ( 2013-04-09 14:24:21 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-06-03 18:12:53 -0500

joshc gravatar image

Try escaping the backslashes: $cmd = "C:\\Windows\\System32\\cmd.exe" or using single quotes $cmd = 'C:\Windows\System32\cmd.exe', but not double backslashes in single quotes.

edit flag offensive delete link more

answered 2013-04-13 14:37:16 -0500

Does it work if you put in path => $::path ? or put the path\to\git in the command

agree llowder suggestions. Were you able to resolve it?

edit flag offensive delete link more


I tried llowder suggestions. Its not working.. I will try with your suggestion and let you know.. Thank you..

dinesh_kumar_logaraj gravatar imagedinesh_kumar_logaraj ( 2013-04-14 22:57:23 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-04-09 06:31:01 -0500

Seen: 356 times

Last updated: Jun 03 '13