Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 在注册表中查找字符串并导出该项名称_Powershell - Fatal编程技术网

Powershell 在注册表中查找字符串并导出该项名称

Powershell 在注册表中查找字符串并导出该项名称,powershell,Powershell,我希望在注册表中的一个特定项中搜索已知字符串的一部分,该项包含大约20个子项。我不需要在注册表中的其他地方搜索。当它被找到时,我需要能够将该键连同完整路径导出到一个变量。这个用例的脚本已经存在。只需在web和MS PowerShellGallery.com上搜索即可。如果你在尝试和失败的过程中遇到了问题,那么就把他们弄得一团糟,然后回来 Get-Command -Name '*registry*' | Format-Table -AutoSize CommandType Name

我希望在注册表中的一个特定项中搜索已知字符串的一部分,该项包含大约20个子项。我不需要在注册表中的其他地方搜索。当它被找到时,我需要能够将该键连同完整路径导出到一个变量。

这个用例的脚本已经存在。只需在web和MS PowerShellGallery.com上搜索即可。如果你在尝试和失败的过程中遇到了问题,那么就把他们弄得一团糟,然后回来

Get-Command -Name '*registry*' | 
Format-Table -AutoSize

CommandType Name                                          Version Source
----------- ----                                          ------- ------
...
Function    Get-RemoteRegistryChildItem                   1.3.6   PowerShellCookbook
Function    Get-RemoteRegistryKeyProperty                 1.3.6   PowerShellCookbook
Function    Grant-RegistryAccessFullControl               1.3.6   PowerShellCookbook
Function    Search-Registry                               1.3.6   PowerShellCookbook
Function    Set-RemoteRegistryKeyProperty                 1.3.6   PowerShellCookbook
...

Find-Module -Name '*registry*' | Format-Table -AutoSize

Version Name                      Repository Description
------- ----                      ---------- -----------
...
0.0.2   PoshRegistry              PSGallery  This module contains functions to create, modify or delete registry subkeys and values on local or remote c...
...
1.0.0.1 xRegistryAccess           PSGallery  Manage registry permissions
...

做得好又容易,伙计。你看起来哪里有问题?我看不到你的坏代码来帮助修复和解释。我还没有,这超出了我的能力。我本来打算明天开始,我知道如何检查某个键和某个值是否存在,但我需要搜索某个特定的文本字符串是否作为某个键/子键范围内的值的一部分出现。不用担心,请在测试完脚本后回来,让我们知道它失败的地方。您好,jayjay80,欢迎使用堆栈溢出!这里的问题预计会显示出研究的努力,也就是说,你已经做了什么来解决你的问题。我们很乐意帮忙,但只有在你自己试过之后。请参阅:。祝你好运