Search Registry


posted by Richard Giles
02-17-2009

Downloads: 438
File size: 870 B
Views: 1,352

Embed
Search Registry
  1. <?xml version="1.0"?> 
  2. <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"
  3.     <CodeSnippet Format="1.0.0"
  4.         <Header> 
  5.             <Title>Search Registry</Title> 
  6.             <Shortcut /
  7.             <Description>search for phrase in registry</Description> 
  8.             <Author /
  9.             <SnippetTypes> 
  10.                 <SnippetType>Expansion</SnippetType> 
  11.             </SnippetTypes> 
  12.         </Header> 
  13.         <Snippet> 
  14.             <Declarations> 
  15.                 <Literal> 
  16.                     <ID>param1</ID> 
  17.                     <ToolTip>Phrase to search for</ToolTip> 
  18.                     <Default>Testing</Default> 
  19.                 </Literal> 
  20.             </Declarations> 
  21.             <Code Language="PowerShell" Kind="8"><![CDATA[$searchText = "$param1$" 
  22.  
  23.     dir HKCU:\ -rec -ea SilentlyContinue |   
  24.        ForEach-Object {   
  25.       if((get-itemproperty -Path $_.PsPath) -match $searchText)  
  26.       {   
  27.          $_.PsPath  
  28.       }   
  29.    }]]></Code> 
  30.         </Snippet> 
  31.     </CodeSnippet> 
  32. </CodeSnippets> 
Filed under: ,

Search for phrase in registry

Copyright 2012 PowerShell.com. All rights reserved.