C# Endpoints for UD

Here’s a neat little Friday experiment I’ve been looking at. New-UDCSharpEndpoint would take in C# code, compile it with Rosyln and then behave like other UDEndpoints. It’s much faster because it is acutal compiled .NET code.

The difference would be no access to cmdlets but if done correctly you should be able to access variables, return JSON, call websockets (the stuff that runs things like Show-UDModal). It should even be possible to create controls since PowerShell just returns hashtables. It’s a lot of work to get that far but having simple C# endpoints might be handy for those high-performance endpoint requirements.

6 Likes

woah, looks fancy man!
and on your cake day!

Hey @adam this is amazing!

Would this allow us to use C# libraries and make use of things like the Azure AD SDK?

Yep. You should be able to use any .NET library.

Hi @adam, in which version this cmdlet is available ?

is this coming in the next UD Release? is there a nightly that has this command available… would like to start tinkering around with this.

Thanks!

@Speegel - This isn’t in the nightly yet (in a different branch) but I could sneak it in for you guys to play with. It doesn’t support passing in variables or anything but you will be able to run C# and return JSON via the endpoints.

2 Likes

Is the cmdlet “New-UDCSharpEndpoint” available in community version of Universal Dashboard? If it is then in what release? Thanks.

This was never released in any version of UD. It never made it out of prototyping.

1 Like

Thanks.

@adam was there a major issue that stopped this from getting out of the prototyping stage? Or just a heavy work item that would not add enough value to be worth the work?

It seemed like an edge-case that wasn’t worth the implementation. There wasn’t much of a blocker here but seemed to deviate from the core functionality of UD as primarily a PowerShell solution and that made me decide not to pursue it. I’ll open-source the prototype when I have time so that others can futz with it if they like.

3 Likes