PSReadLine
PSReadLine copied to clipboard
Allow for alternate data sources for the Predictor source
Prerequisites
- [X] Write a descriptive title.
Description of the new feature/enhancement
Allow for alternate sources, which could include a single or multiple documents, a folder of files, a GitHub repository, etc., that would extend the capability of the Predictor for use with local data without having the requirement of creating a separate Predictor which requires knowledge of creating code.
Proposed technical implementation details (optional)
No response
@mikenelson-io Can you please be more specific on the behavior and user experience you'd like to see? It would be helpful if you can provide some imagined scenarios as examples.
Example: I am not a developer and have no real experience with Visual Studio. i am a system administrator that writes scripts to automate my work. I have created a simple PowerShell module that contains a few functions that I created to help me do my work faster and better. They are my own cmdlets with my own parameters, switches, etc. I will distribute this module to others within my organization and outside as open source. I need a way to utilize the Predictor to assist people when using my module in the command line completion for the cmdlets I wrote. Again, I do not want to take on the burden of creating a Predictor in VS. I simply wish to provide a text or CVS file that contains the cmdlets and allowable parameters and switches. I want the PSReadline PredictionSource to allow me to specify the file so it can search that as part of discovery and provide the cmdlet assistance if it sees a match.
I see this as one example. Allowing the Prediction source to be something other than History or Plugin will allow a more diverse and inclusive discovery for any cmdlet.
So a generalized predictor that can be fed some local input as the "training data" that will be used in predictors. Me and @mikenelson-io talked about this and this does not have to be a different Predictor Source (i.e History, Plugin, none...) necessarily but could be a predictor module that is able to be configured to some location on file to use as the source.
I do really like this idea because yeah you are right that creating a predictor may be hard for folks unfamiliar with C# and binary module development but creating a configurable prediction source is easier way to enable more people. and enables proprietary scripts to be used as predictors 😉