Execute powershell_out within a IF..ELSE block

How do I execute a powershell statement from within a IF…ELSE block in a chef recipe?

I have the following scenario:

ruby_block ‘Test’ do
block do
props = powershell_out("…")
node.default[‘abc’][‘regkey’] = “…“
props = powershell_out(”…”)
props = powershell_out("…")
props.each do |prop|
a = prop.partition(’:’).last
if (a == “X”) && (a == “Y”) && (a == “Z”) && (a == “XY”)
Chef::Log.info(“Nothing to do”)
else
powershell_out("(Get-ItemProperty '#{node[‘abc][‘regKey’]}’ | findstr SQLArg)").stdout.split("\r\n").count
powershell_out("(Set-ItemProperty -Path ‘#{node[‘abc’][‘regKey’]}’ -Name #{newRegProp_count} -Value ‘X’)").stdout
end
end
end

This does not work and the powershell commands do not get executed.
Please can someone help me with the syntax of “chef::util::powershell::cmdlet” to execute the powershell commands.
I