No resource or method named powershell for Chef::Recipe -


when run powershell script on chef -solo on local system ,it give below error message. have added powershell in cookbook,

nomethoderror:------------- no resource or method named `powershell' `chef::recipe "m3"'  cookbook trace: ---------------   c:\chef\cookbooks\balasahebb\recipes\m3.rb:44:in `from_file'  relevant file content: ---------------------- c:\chef\cookbooks\balasahebb\recipes\m3.rb:   37:  #write output status of commands c:\auto\runstatus in forma t status:success or status:failed  38:  39:  template "c:\\auto\\zib.conf"  40:    source "csb_automaticmssql_configuration.erb"  41:    #variables({:hostname => "#{hostname}"})  42:  end  43:  44>> powershell "create configuration directory , copy conf"  45:    code <<-eoh  46:  backloc=(get-itemproperty -path registry::hkey_local_machine\software\zman da\zib).backupsetlocation  47:  mkdir "#{backloc}\#{backupset}"  48:  cp 'c:\\auto\\zib.conf'  "#{backloc}\\#{backupset}\\zib.conf"  49:  50:    eoh  51:    action :run  52:  end  53:   running handlers: [2015-07-15t13:50:01+05:30] error: running exception handlers running handlers complete [2015-07-15t13:50:01+05:30] error: exception handlers complete chef client failed. 0 resources updated in 20.512517 seconds [2015-07-15t13:50:01+05:30] fatal: stack trace dumped c:/chef/cache/chef-stack trace.out [2015-07-15t13:50:01+05:30] fatal: no method error: no resource or method named `p power shell' `chef::recipe "m3"`enter code here`' 

you should add depends 'powershell' metadata.rb file, if want resource available. assuming using powershell community cookbook, , not looking powershell_script resource comes chef.


Comments