OK, limited PS skills and you want to automate messing with the registry.
Uhhhhh… are you sure? 8-}
All that being said.
What you show here is fine with the exception of that you don't show the values to be set nor the command to set the registry key.
These cmdlets are the ones you can use to deal with the registry.
Get-Command -CommandType Cmdlet -Name '*item*'
CommandType Name ModuleName
----------- ---- ----------
Cmdlet Clear-Item Microsoft.PowerShell.Management
Cmdlet Clear-ItemProperty Microsoft.PowerShell.Management
Cmdlet Copy-Item Microsoft.PowerShell.Management
Cmdlet Copy-ItemProperty Microsoft.PowerShell.Management
Cmdlet Get-ChildItem Microsoft.PowerShell.Management
Cmdlet Get-Item Microsoft.PowerShell.Management
Cmdlet Get-ItemProperty Microsoft.PowerShell.Management
Cmdlet Move-Item Microsoft.PowerShell.Management
Cmdlet Move-ItemProperty Microsoft.PowerShell.Management
Cmdlet New-Item Microsoft.PowerShell.Management
Cmdlet Remove-Item Microsoft.PowerShell.Management
Cmdlet Remove-ItemProperty Microsoft.PowerShell.Management
Cmdlet Set-Item Microsoft.PowerShell.Management
Cmdlet Set-ItemProperty Microsoft.PowerShell.Management
Be sure to look at the help files and their examples before use as these also.
https://docs.microsoft.com/en-us/powershell/scripting/getting-started/cookbooks/working-with-registry-entries?view=powershell-6
https://blogs.technet.microsoft.com/heyscriptingguy/2015/04/02/update-or-add-registry-key-value-with-powershell
PSRemoteRegistry 1.0.0.0
This module contains functions to create, modify or delete registry
subkeys and values on local or remote computers.
https://www.powershellgallery.com/packages/PSRemoteRegistry/1.0.0.0
https://stackoverflow.com/questions/28076128/powershell-export-multiple-keys-to-one-reg-file
As we know messing with the registry can really hurt if you are not careful. So, back it up first so you can restore if disaster happens or at least to a system restore point, VM checkpoint/snapshot.
So, here's slight modification to your posted code, but don't take this as final as you need to make decisions on what actions need to be taken and how.
Get-ChildItem "Registry::HKCR" -Recurse -Force `
| where { $_.Name -match 'vlc.'}`
| ForEach-Object {
try {
'Target key to modify / export / whatever'
$_.Name
# 'Registry code here' -WhatIf # remove the whatif if you are sure you are good with what you have
}
catch {
Write-Warning -Message 'Key not accessible'
$_.Name
}
}
The image you've linked is not working. Could you please update it? – Next-Door Tech – 2018-08-08T00:18:12.433