Re: [scripting] looking for powershell script for registry modification

2016-09-07 Thread Isaac Holmes
https://blogs.technet.microsoft.com/heyscriptingguy/2015/04/02/update-or-add-registry-key-value-with-powershell/ On Wed, Sep 7, 2016 at 10:53 AM, Kevin Ray wrote: > Hi All, > > Im looking for path in registry " hklm\system\test" > > Then if test exist, then -name = hai > > If name exist then val

Re: [scripting] looking for powershell script for registry modification

2016-09-07 Thread Sean Martin
Not able to test, but hopefully this points you in the right direction: $key = "HKLM\System\Test" $Name = (Get-ItemProperty -Path $key -Name hai).hai $Valuename = "hai" $Value = "8" If (Test-Path $key) { Write-Host "Registry Path $key exists" If (!($Name) { New-ItemProperty -path $key -name $

[scripting] looking for powershell script for registry modification

2016-09-07 Thread Kevin Ray
Hi All, Im looking for path in registry " hklm\system\test" Then if test exist, then -name = hai If name exist then value should be 8...if value is other than 8 it should set to 8 and if the name "hai"...not exist also it should created " hai" with value 8..any help