开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜