Cannot get response to work with ansible script

194 views Asked by At

I have a simple ansible script where I'm attempting to disable the radios. I would like to use win-shell (powershell) to do this but it expects a response but I can't figure out how to make it work:

I attempted all kinds of things but this is the latest:

-name: Disable wifi and blutooth
  win-sh:
    A '' | Disable-NetAdapter -Name "*"

When I run Disable-NetAdapter in powershell it prompts for a confirm yes, yes to all etc. A selects yes to all.

Can someone help me out with this. I used "expects" but had no luck with that either.

1

There are 1 answers

0
John Verber On

I figured it out.

-name: Disable wifi and blutooth
  win-sh:
    Disable-NetAdapter -Name "*" -Confirm:$false