Sign in
|
Join PowerShell.com!
|
Help
Home
PowerTips
Ask the Experts
Forums
Webcasts
Blogs
eBookV2
Script Library
Twitter Grid
Modules
QuickClick
Scripts
Snippets
Videos
Library
»
Snippet Library
»
Registry
»
Search Registry
Search Registry
Share
|
Browse Library
Module Library
QuickClick Library
Script Library
Snippet Library
ADSI
Comparison
Conditions and Loops
.Net
Exception Handlers
Files and Folders
Functions
Headers
Includes
Network
Pipeline
PowerShell Internals
Registry
Samples
Script Functions Templates
Security
SQL Server
Templates
User Management
WMI
Video Library
Members Only
Tags
Add Value
DWORD
Registry
Snippet
View more
Previous
|
Next
|
View all files
|
View Slideshow
Download
posted by
Richard Giles
02-17-2009
Downloads: 438
File size: 870 B
Views: 1,352
Embed
Search Registry
<?
xml
version
=
"1.0"
?>
<CodeSnippets xmlns
=
"http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"
>
<CodeSnippet Format
=
"1.0.0"
>
<Header>
<Title>Search Registry<
/
Title>
<Shortcut
/
>
<Description>search for phrase
in
registry<
/
Description>
<Author
/
>
<SnippetTypes>
<SnippetType>Expansion<
/
SnippetType>
<
/
SnippetTypes>
<
/
Header>
<Snippet>
<Declarations>
<Literal>
<ID>param1<
/
ID>
<ToolTip>Phrase to search for<
/
ToolTip>
<Default>Testing<
/
Default>
<
/
Literal>
<
/
Declarations>
<Code Language
=
"PowerShell"
Kind
=
"8"
><
!
[CDATA[
$searchText
=
"$param1$"
dir HKCU:\
-rec
-ea
SilentlyContinue |
ForEach-Object
{
if
((
get-itemproperty
-Path
$_
.
PsPath
)
-match
$searchText
)
{
$_
.
PsPath
}
}]]><
/
Code>
<
/
Snippet>
<
/
CodeSnippet>
<
/
CodeSnippets>
Filed under:
Registry
,
Snippet
Search for phrase in registry
Copyright 2012 PowerShell.com. All rights reserved.