I have a value in a databag with a special character in it (a dollar $ sign). In my default.rb file I’m getting the value
string = data_bag_item(‘strings’, ‘mystring’)[‘value’]
Then later in my recipe I have the following:
powershell_script ‘script’ do
code <<-EOH
write-host " ‘#{string}’ "
EOH
end
If my string was some$tring what I end up seeing is “some”
It seems like ruby is treating $tring as a global variable. How do I avoid that? I tried to escape the value in my databag using some$string but then its not valid JSON.
How can I work around this?
Thanks
Brad