Ruby syntax error


Hi All,

Iam beginner in chef
Wrote a chef cookbook for Symantec installation while upload my cookbook gives Cookbook file has a ruby syntax error:
Iam not sure cookbook is right to password the windows powershell commands
NFS mount is happening
Help me to complete this
My cookbook

execute “directory symantec” do
command “mkdir c:\symantec”

execute “map drive” do
command “net use z: \\var\nfs\general”

execute “Copy source” do
command “PowerShell Copy-Item -Recurse “Z:\symantec\Sep_client_12.1_English\Sep-client” -Destination “C:\symantec””

execute “Execute the install” do
command “PowerShell Start-Process -FilePath “C:\symantec\Sep-client\Setup.exe” -ArgumentList “/S /v/qn””

execute “Remove the directory” do
command “rmdir /S /Q C:\symantec”


Hey @venkatraj

First of all, I suggest your read more about chef documentation, especially it’s directory resource :

Next, please format your code using the preformated text.

Finally, to answer your question, it seems to me you’ve got some extra quote here
command “PowerShell Copy-Item -Recurse “Z:\symantec\Sep_client_12.1_English\Sep-client” -Destination “C:\symantec””

You can use rubocop to help you find errors in your code.


Iam trying as per the chef doc :

Iam unable to mount the remote linux drive in command line iam able to : net use z: \\var\nfs\general

directory ‘C:symantec’ do
action :create
recursive true
rights :full_control, “dstadmin”, :applies_to_children => true

mount ‘G:’ do
action :mount
device ‘\\\var\nfs\general’