riv*_*mey 5 powershell networking netconnection windows-10
如果没有设置,如何创建新的“Windows 位置”设置?
一段时间以来,我的 Win10 Pro 系统一直在完美的以太网堆栈上运行,但没有设置“网络位置”,这意味着某些服务无法正常工作(或根本无法工作),因为 Windows 本质上是在“公共”中运行模式并禁用它们。
我已经尝试过多轮禁用/删除驱动程序、重置或删除注册表项等。我最近看到这篇文章,其中有一些新信息。所以我现在知道:
在提升的 PowerShell 中,Get-NetConnectionProfile 不返回任何内容 - 根本不返回任何条目。在同一窗口中使用 ipconfig 返回预期信息:
PS C:\WINDOWS\system32> ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : ivimey.org
IPv4 Address. . . . . . . . . . . : 192.168.43.14
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.43.1
Run Code Online (Sandbox Code Playgroud)
所以我尝试使用 Set-NetConnectionProfile:
PS C:\WINDOWS\system32> Set-NetConnectionProfile -InterfaceAlias Ethernet -NetworkCategory Private
Set-NetConnectionProfile : No MSFT_NetConnectionProfile objects found with property 'InterfaceAlias' equal to 'Ethernet'. Verify the value of the property and retry.
At line:1 char:1
+ Set-NetConnectionProfile -InterfaceAlias Ethernet -NetworkCategory Pr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Ethernet:String) [Set-NetConnectionProfile], CimJobException
+ FullyQualifiedErrorId : CmdletizationQuery_NotFound_InterfaceAlias,Set-NetConnectionProfile
Run Code Online (Sandbox Code Playgroud)
我还尝试使用 -Name 而不是 -InterfaceAlias 获得相同的结果。
有任何想法吗?
| 归档时间: |
|
| 查看次数: |
2375 次 |
| 最近记录: |