kusto-loco
kusto-loco copied to clipboard
Find a way to publish a single-file dll for the powershell modules
It's very frustrating that the powershell modules need to be published as a rather random collection of dlls. This has already caused problems with installations failing as environments and net verisons change.
Unfortunately the -self-contained flag seems to be ignored when publishing dlls.
Do you have to use Powershell? Is there a specific example you can share?
Ah.. the context is a bit cryptic here since it was mainly a note-to-self....
This concerns the way the edit-kql powershell module is built. It's compiled as a powershell cmdlet into a dll called "pskql.dll". The building is done (for publishing) via the build.ps1 script. You'lll notice a few lines further down there is an attempt to remove the framework dlls from the distributed set which ends up in publish\pskql folder
There are sevveral annoying things about this:
- The user has to install a whole load of dlls rather than jsut one
- The heuristic for removing framework dlls is probably not terribly reliable (System and Microsoft)
- The inability to make the dll "self-contained" means that clashes with the environment are possible. Specifically, at this very moment kusto-loco is stuck on System.Text.Json v8.0.5 because for some reason powershell throws a wobbly if v9.0.0 is used in pskql
It's probably possible to create a self-contained pskql using ILMERGE but atm it seems likely that the net9/powershell incompatibitly will be fixed before I have time to wrestle with that.
Is the issue that you ultimately need to: "allow objects to be piped into a KustoLoco table and queried."?
- What type of data (real-time streaming, parquet, others...)?
- Any other methods that would work (that are easy for the end-user to use)?
In my project I only allow you to bring in data using: Excel, csv, parquet, SQL server, Fabric. If they want real-time streaming I'm gonna make them use Fabric.
I think I haven't explained myself very well :-) If you live in the terminal and use powershell a lot (as I do) , it's quite cool to be able to use a kql query to process your powershell pipeline. For example...
pskql is a powershell cmdlet which does that for you
(Obviously you could do that with powershell commands just as well but kql has some nice features such as summarization that make it more useful in some scenarios)
Ohh yeah I don't use terminal at all.
See https://medium.com/@rakesh.mr.0341/merging-net-class-libraries-into-a-single-assembly-with-ilmerge-cba0d35ce91d