This topic contains 3 replies, has 3 voices, and was last updated by
April 27, 2015 at 2:38 pm #24751ParticipantPoints: 1Rank: Member
I thought the pipe was part of the problem. Thanks for confirming my suspicion.
Since I am so new at this, the carriage return makes it much easier to read. However, the semicolons will come in handy eventually. Thanks for the tip!
While I have your attention, I have moved on to my next obstacle... I need to modify an existing registry key value. Below is what I am using...
New-Item -Path HKLM:\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order -Name ProviderOrder -Value "PnSson,RDPNP.LanmanWorkstation,webclient" -Force
the -Name argument keeps adding a new key under "Order" instead of updating the existing sub-key (see attached 'Reg_ProviderOrder.jpg'). Based on what I have read, this isn't what should happen. I want it to modify the existing sub-key that is highlighted in the second attachment ('Reg_ProviderOrder_02.jpg'). I will keep digging however, if you have any ideas...
April 27, 2015 at 2:44 pm #24756KeymasterPoints: 1,811Rank: Community Hero
You don't have "sub-keys" in PowerShell.
You have items, which have item properties. In RegEdit, an "item" is a folder; what appears on the right-hand pane are "Item Properties."
Get-Command -Noun ItemProp*
April 27, 2015 at 2:44 pm #24757KeymasterPoints: 1,811Rank: Community Hero
You should also be able to run "Help Registry" to get help on the Registry PSProvider, which includes a lot of useful registry-specific examples.
May 2, 2015 at 5:51 pm #24910ParticipantPoints: 0Rank: Member
$computer = 'MyPC' $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey['LocalMachine',$computer] $key = $reg.OpenSubKey['SYSTEM\CurrentControlSet\Control\NetworkProvider\Order', $true] $key.SetValue['ProviderOrder', 'PnSson,RDPNP.LanmanWorkstation,webclient', 'String'] $key.Close $key.Dispose $reg.Close $reg.Dispose
Not sure how to stop it from adding  when it should be ()
The topic ‘Editing Registry’ is closed to new replies.