Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Disable all disconnected ethernet ports

$
0
0

I'm trying to script the configuration of my ethernet ports on my server.  I want to disable all ports that do not have a cable plugged into it.  I have this command -

Get-NetAdapter -Name * | ? status -eq Disconnected | Disable-NetAdapter

This works however it prompts me to confirm before moving on to the next part of my script.  How do I script it to auto confirm yes to all?

Ryan


Viewing all articles
Browse latest Browse all 15028

Trending Articles