0

I am running a series of Remove-NetIPAddress and New-NetIPAddress powershell commands. They run fine in interactive mode locally on the machines.

When run through ansible, they fail as they usually prompt the user to confirm the actions.

I have tried -Force, -Confirm:$false to no avail. When I use them, the plays simply hang.

Does anyone know how to get "interactive" powershell commands working?

Derek
  • 357
  • 1
  • 5
  • 16

1 Answers1

0

I don't have access to those cmdlets ATM but if it indeed behaves in such way that you can't prevent prompt you could work around it:

  • run command in background job and kill it after some time period (this will not the get the job done always as you said that sometimes it prompts but you will at least have a script unblocked).
  • implement one of the console automation methods I described here.
Community
  • 1
  • 1
majkinetor
  • 8,730
  • 9
  • 54
  • 72