Kis*_*han 5 powershell powershell-ise powershell-2.0 powershell-3.0
我尝试使用如何使用 Set-NetConnectionProfile 更改 NetConnectionProfile 的名称
$Profile=Get-NetConnectionProfile -InterfaceIndex 35
$Profile.Name = "Network1"
Run Code Online (Sandbox Code Playgroud)
错误是
"Name" is a ReadOnly property.
At line:1 char:1
+ $Profile.Name = "Network1"
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) []
+ FullyQualifiedErrorId : ReadOnlyCIMProperty
Run Code Online (Sandbox Code Playgroud)
如何更改名称的只读属性??帮我
小智 6
您可以通过直接注册表版本来执行此操作。
在 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles 项下
您可以看到网络配置文件密钥(通过它的 uuid),并且可以更改适当的网络 ProfileName 值。
小智 1
当您读取这些名称时,Name 属性是只读的。
$Profile=Get-NetConnectionProfile -InterfaceIndex 35
Run Code Online (Sandbox Code Playgroud)
您正在尝试获取特定的配置文件索引名称。然后将其声明为“Network1”
了解如何按属性名称使用 PowerShell 值绑定
了解和使用 PowerShell 配置文件