Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.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
在windows注册表编辑器中递归创建键_Windows_Powershell_Registry - Fatal编程技术网

在windows注册表编辑器中递归创建键

在windows注册表编辑器中递归创建键,windows,powershell,registry,Windows,Powershell,Registry,我需要使用Powershell在windows的注册表编辑器中递归创建一个密钥md HKLM:\Software\a\b\c在此命令中,仅当父项a存在时,才会创建b和c键,但我希望递归地创建a\b\c。请在这方面帮助我。使用-Force参数: PS C:\> md HKLM:\Software\a\b\c PS C:\> Test-Path HKLM:\Software\a\b\c False PS C:\> md HKLM:\Software\a\b\c -Force PS

我需要使用Powershell在windows的注册表编辑器中递归创建一个密钥
md HKLM:\Software\a\b\c
在此命令中,仅当父项a存在时,才会创建b和c键,但我希望递归地创建
a\b\c
。请在这方面帮助我。

使用
-Force
参数:

PS C:\> md HKLM:\Software\a\b\c
PS C:\> Test-Path HKLM:\Software\a\b\c
False
PS C:\> md HKLM:\Software\a\b\c -Force
PS C:\> Test-Path HKLM:\Software\a\b\c
True