Skip to main content

Posts

Showing posts from August, 2018

I made a GIF!

Explaining Jason Stangroome's "PowerShell Registry Find and Replace" article

On 2007-08-02, Jason Stangroome posted a blog article "PowerShell Registry Find and Replace" at URL http://blog.stangroome.com/2007/08/02/powershell-registry-find-and-replace/ . The article is still there, however the PowerShell code is presented without a examples or a usage statement. Hence I am re-posting his content here, reformatted for legibility and with an example. PowerShell function Find-RegistryValue requires one parameter, -seek , of type string. The string should be wrapped in single or double quotes and contain appropriate character escapes; for example use '\\' versus '\'. The -regpath parameter is automatically populated by Get-Location , do not attempt to provide it as a string.  Instead use Set-Location Registry::[...] first to provide the proper context before running Find-RegistryValue . function Find-RegistryValue ( [string] $seek = $(throw “seek required.”), [System.Management.Automation.PathInfo] $regpath = (Get-Location)