Bird
0
0

You want to export all values under HKCU:\Software\MyApp to a file, modify a value, then import back. Which approach is correct?

hard📝 Application Q9 of 15
PowerShell - System Administration
You want to export all values under HKCU:\Software\MyApp to a file, modify a value, then import back. Which approach is correct?
AUse Export-RegistryFile to export, edit file, then Import-RegistryFile to import
BUse Get-ItemProperty to export, modify in memory, then Set-ItemProperty to update
CUse Remove-Item to delete all keys, then recreate them manually
DUse reg export and reg import commands from PowerShell to handle the registry file
Step-by-Step Solution
Solution:
  1. Step 1: Understand PowerShell native cmdlets

    PowerShell does not have Export-RegistryFile or Import-RegistryFile cmdlets.
  2. Step 2: Use reg.exe commands

    Windows reg.exe supports export/import of registry keys to files.
  3. Step 3: Modify exported file externally

    Edit the exported .reg file, then import it back with reg import.
  4. Final Answer:

    Use reg export and reg import commands from PowerShell to handle the registry file -> Option D
  5. Quick Check:

    Use reg.exe for export/import of registry files [OK]
Quick Trick: Use reg.exe commands for registry export/import tasks [OK]
Common Mistakes:
  • Assuming PowerShell has export/import cmdlets
  • Trying to export with Get-ItemProperty only
  • Deleting keys instead of exporting/importing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes