Ask Your Question

how to create a folder in the name which stored in the variable? (windows)

asked 2016-04-06 05:19:57 -0600

yoga gravatar image

I stored the folder name in variable . Then i use that variable in my manifest to create a folder. But it create folder in the name of variable name not what is in that variable.


       class currentgen::backup::folder_backup
      ($prodequ_backup_loc        = $prodequ_backup_loc,
       inherits currentgen{
                  exec{"current date time folder":
                           command=>'C:\Windows\System32\cmd.exe /c "md $time"',

above code create the directory name of "$time".

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-08 00:11:56 -0600

yoga gravatar image

By using File resource ,can able to create folder which name stored in variable. code below:

class currentgen::backup::folder_backup
($prodequ_backup_loc        = $prodequ_backup_loc,
 ) {
      ensure => directory,
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2016-04-06 05:19:57 -0600

Seen: 173 times

Last updated: Apr 08 '16