How to stub powershell.exe in chefspec?

I resolved this issue by stubbing out the call to chocolatey_installed? instead.

  before(:each) do
    allow_any_instance_of(Chef::Resource).to receive(:chocolatey_installed?).and_return(true)
  end