Just now starting to implement a command line interface utilizing the new System.Commandline package and using the approach of the SCL example project. Which I really like, thanks for that. The client more or less maps the console input to gRPC messages and should provide an interactive service interface utilizing the duplex capabilities gRPC brings. Since I do all the work implementing the gRPC interface for the console I would like to have a non interactive option beeing able to provide an option to automate all these commands within a script. I spend quite a while researching for options like pipe the stdin/out, C# REPL, determining if keyboard is available, overwriting IConsole, dotnet script CLI and finally writing cmdlets. To be honest I am not really happy with these options and I am wondering if I may missed something with System.Commandline? The requirement is simple: to provide a (typed) output/input to realize command chains within a script running in an MS Windows environment.
Asked
Active
Viewed 73 times
0
-
1I think your question needs a bit more clarity. But if I understand it correctly, you want to pipe the input and output of gRPC requests and responses with the gRPC client being implemented by you in a (C# ?) console app? Then you should probably code PowerShell Cmdlets for the gRPC calls in the console app, and use [pipelines](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pipelines?view=powershell-7.2). – dan-kli Aug 18 '22 at 13:29
-
Yes and I gave it a look to write cmdlets but that's quite some work considering there are dozends of commands. Also I would have to implement all the options and arguments I already did within the console application. That's why I reached out. – Freddy_Fresh Aug 18 '22 at 13:38