Skip to content

Add RegistryHive extension members: Moniker and OpenKey#66

Merged
Tyrrrz merged 5 commits intoprimefrom
copilot/add-registry-extensions
Apr 19, 2026
Merged

Add RegistryHive extension members: Moniker and OpenKey#66
Tyrrrz merged 5 commits intoprimefrom
copilot/add-registry-extensions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

Ports RegistryHive extensions from LightBulb into PowerKit, extending the existing RegistryExtensions with a new extension(RegistryHive hive) block.

Changes

  • Moniker — property that maps a RegistryHive value to its conventional short name (HKCU, HKLM, HKCR, HKU, HKPD, HKCC); annotated with [SupportedOSPlatform("windows")] since RegistryHive enum values are Windows-only on .NET 5+.
  • OpenKey(RegistryView view = RegistryView.Default) — wraps RegistryKey.OpenBaseKey; guarded with #if NET40_OR_GREATER || NET5_0_OR_GREATER since RegistryView and the corresponding OpenBaseKey overload are unavailable on .NET 3.5.
RegistryKey key = RegistryHive.CurrentUser.OpenKey(RegistryView.Registry64);
string moniker = RegistryHive.LocalMachine.Moniker; // "HKLM"

@Tyrrrz Tyrrrz added the enhancement New feature or request label Apr 18, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review April 18, 2026 19:57
Copilot AI review requested due to automatic review settings April 18, 2026 19:57
Comment thread PowerKit/Extensions/RegistryExtensions.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports RegistryHive extension helpers into PowerKit by extending RegistryExtensions with a new extension(RegistryHive hive) block, complementing the existing RegistryKey extensions.

Changes:

  • Added RegistryHive.GetShortMoniker() to map common hives to short names (e.g., HKCU, HKLM).
  • Added RegistryHive.OpenKey(RegistryView view = RegistryView.Default) (guarded for NET40_OR_GREATER || NET5_0_OR_GREATER) as a wrapper over RegistryKey.OpenBaseKey.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread PowerKit/Extensions/RegistryExtensions.cs Outdated
Comment thread PowerKit/Extensions/RegistryExtensions.cs
Tyrrrz and others added 2 commits April 18, 2026 23:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 18, 2026

@copilot please fix build errors

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 18, 2026

@copilot fix build errors

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 18, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/PowerKit/PowerKit/PowerKit.Tests/bin/Release/net10.0/PowerKit.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/PowerKit/PowerKit/PowerKit.Tests/bin/Release/net10.0/PowerKit.Tests.deps.json /home/REDACTED/work/PowerKit/PowerKit/PowerKit.Tests/bin/Release/net10.0/testhost.dll --port 38293 --endpoint 127.0.0.1:038293 --role client --parentprocessid 4747 --datacollectionport 0 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add RegistryHive extension methods: GetShortMoniker and OpenKey Add RegistryHive extension members: Moniker and OpenKey Apr 18, 2026
Copilot AI requested a review from Tyrrrz April 18, 2026 20:22
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

❌ Patch coverage is 37.50000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.98%. Comparing base (ca0f66e) to head (c560923).
⚠️ Report is 4 commits behind head on prime.

Files with missing lines Patch % Lines
PowerKit/Extensions/RegistryExtensions.cs 9.09% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            prime      #66      +/-   ##
==========================================
- Coverage   94.89%   93.98%   -0.92%     
==========================================
  Files         120      124       +4     
  Lines        2332     2459     +127     
  Branches      177      197      +20     
==========================================
+ Hits         2213     2311      +98     
- Misses         85      107      +22     
- Partials       34       41       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants