DUX_NEKRON
asked on
How i search all values and/or registry keys of a term with powershell to do mass deletion ou replacement?
How i search a term, like "nvidia" inside registry with powershell to delete or replace all related values and keys with another one like "nvidia2"?
.
.
Thanks Experts.
.
.
Thanks Experts.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wonderful soostibi!!!
How can i save and call the SearchRegistry function ?
Thank you
How can i save and call the SearchRegistry function ?
Thank you
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It didint worked.
Let's describe my steps:
(enable custom scripts)
1 - PS E:\> set-executionpolicy unrestricted
(the complete script solution)
2 - PS E:\> .\11scr.ps1
(for test)
3 - PS E:\> SearchRegistry -search Microsoft -root HKCU:\Software -recurse $false | Format-Table
Bad result, the log:
Let's describe my steps:
(enable custom scripts)
1 - PS E:\> set-executionpolicy unrestricted
(the complete script solution)
2 - PS E:\> .\11scr.ps1
(for test)
3 - PS E:\> SearchRegistry -search Microsoft -root HKCU:\Software -recurse $false | Format-Table
Bad result, the log:
PS E:\> get-help set-executionpolicy
PS E:\> set-executionpolicy unrestricted
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies
help topic. Do you want to change the execution policy?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
PS E:\> .\11scr.ps1
PS E:\> SearchRegistry -search Microsoft -root HKCU:\Software -recurse $false | Format-Table
The term 'SearchRegistry' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the p
ath is correct and try again.
At line:1 char:15
+ SearchRegistry <<<< -search Microsoft -root HKCU:\Software -recurse $false | Format-Table
+ CategoryInfo : ObjectNotFound: (SearchRegistry:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS E:\>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you soostibi, wonderful script and explanation, it worked like a charm, and Alok-Agarwal too to how proceed with powershell scripts
Cheers
DUX_NEKRON
Cheers
DUX_NEKRON
You can set the $search and $root to test it.
Open in new window