I am trying to get registry key values but i am facing issues.
Following is the command i tried to execute.
Get-ChildItem "HKEY_LOCAL_MACHINE\SFTWARE\Wow6432Node\Mycompany\MyProj\Model" | ForEach-Object {Get-ItemProperty $_.pspath}
But in registry key path appended with current working directory and produce unexpected issue like below.
PS C:\Users\Administrator\Desktop\MyDoc\Core\NodeRenameMaster> Get-ChildItem "HKEY_LOCAL_MACHINE\S
FTWARE\Wow6432Node\Mycompany\MyProj\Model" | ForEach-Object {Get-ItemProperty $_.pspath}
Get-ChildItem : Cannot find path 'C:\Users\Administrator\Desktop\MyDoc\Core\NodeRenameMaster\HKEY_
LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mycompany\MyProj\Model' because it does not exist.
At line:1 char:14
+ Get-ChildItem <<<< "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mycompany\MyProj\Model" | ForEach-Object {Get-Item
Property $_.pspath}
+ CategoryInfo : ObjectNotFound: (C:\Users\Admini...\Model:String) [Get-ChildItem], ItemNotFound
Exception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
Why it occurs ? How to solve this ?
The path is invalid, replace ‘HKEY_LOCAL_MACHINE’ with ‘HKLM:\’ and ‘SFTWARE’ with ‘SOFTWARE’