Skip to content
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

Find a way to publish a single-file dll for the powershell modules #90

Open
NeilMacMullen opened this issue Jan 4, 2025 · 6 comments
Open
Labels
help wanted Extra attention is needed

Comments

@NeilMacMullen
Copy link
Owner

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.

@NeilMacMullen NeilMacMullen added the help wanted Extra attention is needed label Jan 4, 2025
@ADefWebserver
Copy link
Contributor

Do you have to use Powershell? Is there a specific example you can share?

@NeilMacMullen
Copy link
Owner Author

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:

  1. The user has to install a whole load of dlls rather than jsut one
  2. The heuristic for removing framework dlls is probably not terribly reliable (System and Microsoft)
  3. 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

@NeilMacMullen
Copy link
Owner Author

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.

@ADefWebserver
Copy link
Contributor

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.

@NeilMacMullen
Copy link
Owner Author

NeilMacMullen commented Jan 11, 2025

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...
image

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)

@ADefWebserver
Copy link
Contributor

Ohh yeah I don't use terminal at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants