powershellconfirmation

PowerShell - Removing IP - Addresses with Remove-NetIPAddress


.

Hey Guys,

one short question regarding the removing of IP Addresses with PowerShell. I'm actually developing an automatic scripts, which also configures the network settings. For this reason, I need it to remove the IP Address. If I'm using the regular "Remove-NetIPAddress" command, i have to confirm the removal and there is no "-Force" parameter.

Is there any other solution to remove the ip address without confirmation ?

Thanks a lot.

Best regards
NumeroUnoDE


Solution

  • Remove-NetIPAddress may not have a -Force parameter, but it does have a -Confirm switch.

    Add that to your command as -Confirm:$false