I have a need to modify registry from PS. This registry item is related to context menu for particular files (folder for all extensions).
\\HKEY_CURRENT_USER\Software\Classes\*
Currently I'd like to add items to this path:
HKCU:\Software\classes\*
|- shell
|- shellex
However when I do dir on this path, there is output of all items in classes
folder:
PS D:\> dir "HKCU:\Software\classes\*"
Hive: HKEY_CURRENT_USER\Software\classes
Name Property
---- --------
*
.3g2 VLC.backup : WMP11.AssocFile.3G2
(default) : VLC.3g2
.3gp VLC.backup : WMP11.AssocFile.3GP
(default) : VLC.3gp
.3gp2 VLC.backup : WMP11.AssocFile.3G2
(default) : VLC.3gp2
.3gpp VLC.backup : WMP11.AssocFile.3GP
(default) : VLC.3gpp
.3mf
If I understand it correctly, my query is being wildcarded by asterisk. The registry item (folder) is named *
. How do I create selector just for this folder and not make it work as a wild-card? Also should work for all other commands, not just the dir
(Get-ChildItem
).
Already tried these with no success:
PS D:\> dir "HKCU:\Software\classes\**"
PS D:\> dir "HKCU:\Software\classes\\*"
PS D:\> dir "HKCU:\Software\classes\'*'"
PS D:\> dir "HKCU:\Software\classes\`*"
Workaround for Get-ChildItem
:
# argument -LiteralPath, unfortunatelly only for "dir" command
PS D:\> dir -LiteralPath "HKCU:\Software\classes\*"
Edit:
As I have received answers related particulary to Get-ChildItem
, please assume that same path should work for New-Item
(which doesn't support -LiteralPath
).