-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Add -PropertyType
argument completer for New-ItemProperty
#21117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add -PropertyType
argument completer for New-ItemProperty
#21117
Conversation
-PropertyType
argument completer for New-ItemProperty
-PropertyType
argument completer for New-ItemProperty
src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs
Show resolved
Hide resolved
-PropertyType
argument completer for New-ItemProperty
-PropertyType
argument completer for New-ItemProperty
Thanks @iSazonov, I've changed implementation to check if registry provider is used. Also @MartinGC94 let me know what you think, took some inspiration from your argument completer 🙂. |
-PropertyType
argument completer for New-ItemProperty
-PropertyType
argument completer for New-ItemProperty
src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall logic seems fine, but I agree with @iSazonov suggestion about not converting all of the paths to an array. If you change that + my minor suggestions then I would be fine with this.
src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs
Outdated
Show resolved
Hide resolved
Thanks @iSazonov and @MartinGC94 for the comprehensive and helpful feedback. I have made changes to address the comments, please have a look and let me know if I've missed anything. For the multiple paths, I am now just running |
7763f77
to
d0373c0
Compare
src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs
Outdated
Show resolved
Hide resolved
-PropertyType
argument completer for New-ItemProperty
-PropertyType
argument completer for New-ItemProperty
2af476e
to
a8d8dc3
Compare
📣 Hey @ArmaanMcleod, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
PR Summary
Fixes #21116
This PR adds an argument completer for Option 1 described in linked issue.
Add
-PropertyType
argument completer forNew-ItemProperty
command.PR Context
Currently you cannot tab complete registry value kinds for
New-ItemProperty -PropertyType
. This PR adds aPropertyTypeArgumentCompleter
which matcheswordToComplete
against the possible enum values ofRegistryValueKind
.PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).