windows directory share in Chef

87 views
Skip to first unread message

Rob Marlow

unread,
Mar 31, 2015, 12:31:52 PM3/31/15
to opscode-che...@googlegroups.com
I am a beginner to Chef and I have been working on setting up a Windows node in a local test environment. I couldn't find anything in the docs on the directory section, and the powershell block is not working from Chef. 

directory 'sharefolder' do
rights :full_control, "rob"
rights :read, ["Administrators","Everyone"]
path "c:/inetpub/wwwroot/sharefolder"
        action :create
end

powershell_script "sharefolder-Share" do
    code <<-EOH
  $Shares=[WMICLASS]”WIN32_Share”                             
  $Shares.Create("C:/inetpub/wwwroot/sharefolder", "sharefolder", 0 ) 
  EOH
end


The powershell works locally and I don't have any errors in the Chef run. Any help would be greatly appreciated. 

Thanks 
Rob 
Reply all
Reply to author
Forward
0 new messages