I have a chef powershell_script which seems to be running whenever the not_if guard throws an exception, I would like to change it so that the chef run fails when the not_if throws an exception, would that be possible?
Here's some really simplistic code, at the moment it seems to create the file, even though the guard is throwing an exception.
powershell_script 'create file if no error' do
code <<-EOH
Write-Output 'File Created' | Out-File c:/users/vagrant/desktop/files.txt
EOH
not_if 'throw bad call'
end
Thanks,
Alex