Powershell - how to create network adapter (loopback)?
I want to create a loopback network adapter with powershell.
I can get an adapter using code like this.
$networkAdapter = Get-WMIObject win32_Netw开发者_运维问答orkAdapter | where{$_.ServiceName -eq 'msloop'}
However, I cannot seem to find how to create an adapter. The only thing I found uses devcon.exe
.\devcon.exe -r install $env:windir\Inf\Netloop.inf *MSLOOP | Out-Null
This is going to be for a windows 7 box and I didn't want to have to install some other package just to do it. If devcon is required then is there a way to include the download and setup in the script as well?
精彩评论