[英]Failing to disable a Get-wmiobject win32_NetworkAdapter via PowerShell (dell venue 8 pro) (windows10)
I'm trying to reproduce the instructions of https://github.com/vstarostenko/dv8p_wifi_issue_fix/blob/master/README.md But while everything seems correct, the system is just not following orders (which is to disable the network adapter). 我正在尝试重现https://github.com/vstarostenko/dv8p_wifi_issue_fix/blob/master/README.md的说明,但是,尽管一切似乎正确,但系统并未遵循命令(即禁用网络适配器) 。 It runs a windows10 system, I didn't try with the previous version.
它运行的是Windows10系统,我没有尝试使用以前的版本。
What I've done: 我所做的:
*Using the first line or the second doesn't make any difference *使用第一行或第二行没有任何区别
#$adapter = Get-WmiObject Win32_NetworkAdapter | where {$_.DeviceID -eq 1}
$adapter = Get-WmiObject Win32_NetworkAdapter -computerName LocalHost -filter "DeviceId = 1"
$adapter.Availability
$adapter.Disable()
$adapter.Availability
Then I get an unchanged status, precisely this 然后我得到一个不变的状态,正是这个
3
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 0
PSComputerName :
3
From what I've read, this should work. 根据我的阅读,这应该有效。 What's failing?
怎么了
[SOLVED] Not knowing why it doesn't work, I have done it in the following way: [已解决]不知道为什么它不起作用,我已经通过以下方式做到了:
Get-NetAdapter -Name Wi-Fi | fl Status
Get-NetAdapter -Name Wi-Fi | Disable-NetAdapter -Confirm:$false
Get-NetAdapter -Name Wi-Fi | fl Status
Get-NetAdapter -Name Wi-Fi | Enable-NetAdapter -Confirm:$false
Get-NetAdapter -Name Wi-Fi | fl Status
Availablity
doesn't specify enabled/disabled, but if the network adapter is available, ex. Availablity
未指定启用/禁用,但是如果网络适配器可用,例如。 not working, not enough Power, no driver(i think). 没有工作,没有足够的功率,没有驱动程序(我认为)。
NetEnabled
specifies if the network adapter is enabled/in use (will show false on enabled wifi if not Connected to network). NetEnabled
指定是否启用/正在使用网络适配器(如果未连接到网络,则在启用的wifi上将显示false)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.