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
WIP: Provide a way to convert the output of native executables to objects #19257
Conversation
09bdbfd
to
e49a003
Compare
Still need to settle on how to avoid invocation of the json adapter.
Also remove AutoJsonAdapter property from ApplicationInfo (JsonAdapter is enough). Disable autoconversion if direction is used.
Remove modification of commandline history, it now reports what the user typed. Add tests for calling the adapter and validating that the history object has the proper property and value.
Also remove AutoJsonAdapter property from ApplicationInfo (JsonAdapter is enough). Disable autoconversion if direction is used.
Since we're using 2 different executables between Windows and Unix, we need to be sure we're using the correct adapter.
…lement is the adapter.
e49a003
to
984c2f8
Compare
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
while this was an interesting approach, it's been decided that a feedback/suggestion approach would be a better experience. |
PR Summary
This PR is a partial implementation of PowerShell/PowerShell-RFC#341
It enables automatically calling a function or script after a native application if that function has the name of -json.
PR Context
As outlined in the RFC, interacting with the output of native executables could be improved by converting the text output to objects which can then take advantage of the rest of the PowerShell infrastructure. This PR implements an approach which automatically adding a function/script named in a specific way immediately following a command.
It is somewhat tiresome to have to provide an entire pipeline to do this:
uname -a | jc --uname | convertfrom-json
It would be more convenient to just be able to type:
uname
and have a resultant object returned into the PowerShell environment.
By implementing a simple function, it would be possible to support this.
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).