Skip to content

New-ItemProperty -PropertyType should have tab completion #21116

@ArmaanMcleod

Description

@ArmaanMcleod

Summary of the new feature / enhancement

Currently New-ItemProperty -PropertyType does not have tab completion for the following registry value kinds below:

Unknown
String
ExpandString
Binary
DWord
MultiString
QWord
None

Which are documented here.

Additionally, something worth noting is the type documented for this parameter is RegistryValueKind but the type is actually string, which seems like an issue in itself to fix the documentation. Can probably raise another issue for this.

Proposed technical implementation details (optional)

Option 1

  • Create argument completer which goes through values of RegistryValueKind and matches wordToComplete with possible enum values.
  • Make sure path is using Registry provider and ignore any other provider.
  • Add ArgumentCompleter attribute to PropertyType parameter.

Option 2 (Preferrable)

  • Change type of PropertyType to RegistryValueKind. This will enable tab completion automatically since this type is an enum.
  • Benefit here is that it aligns directly with documentation and is simpler. I don't believe this is a breaking change, since user can use enum parameter with strings the same way as before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PRIndicates that a PR is out for the issueIssue-Enhancementthe issue is more of a feature request than a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions