开发者

Powershell - how to create network adapter (loopback)?

开发者 https://www.devze.com 2023-04-07 19:28 出处:网络
I want to create a loopback network adapter with powershell. I can get an adapter using code like this.

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

精彩评论

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

关注公众号