I am trying to write a recipe which should be able to create/update a key in windows registry.
The issue is, the key does not get created until the whole scripts gets completed. I need to use the new value of the created/updated key in the later section of the recipe.
Below is the recipe code I am trying to execute.
registry_key KEY_PATH do
:name => “Readyforshutdown”,
:type => :dword,
:data => 1
puts 'registry created’
puts 'sleeping '
The output I get is, the registry_key “Readyforshutdown” gets created/updated only after the “sleep 30” also gets executed.
What do I need to do so that I can see the registry_key “Readyforshutdown” gets new value as soon as I get "registry created’ message and not after “sleep 30” (which is end of my script).