How can i use PowerShell commands as an ‘only_if’ ‘not_if’ condition in a non powershell Chef resource?
Is i possible?
For example :
package 'Application X' do
source "#{Chef::Config['file_cache_path']}\App\Setup.exe"
installer_type :custom
action :install
returns [0, 3010]
not_if
powershell_script
code <<-EOH
$file_version = (Get-Item E:\App\App\appx.exe).VersionInfo.FileVersion
$file_version != node['app']['version']
EOH
end
end
Many thanks for taking a look - hopefully its simple
Edit : continuing my searches I found shell-out or Mixlib::ShellOut.new - not sure if those are relevent to this