Ideas for a sigle .ps1 file containing UD + dashboard script


#1

I am plaing to move a little windows forms tool to UD. The ultimate goal is to only have an .exe file that contains everything to run the dashbaord.
It is not possible to permanetly install UD in the modules path.

My first idea is to zip the UD module, encode it to a base64 string and put it directly into the main .ps1 file.
The first thing the script will do is to decode and unzip UD and then run the dashboard.

Any ideas how to handle this more elegant?


#2

I haven’t found a more elegant solution than that. I do the same thing in the PowerShell Pro Tools packager.

The first time start up is kinda slow but if you have some logic in there to avoid unzipping if it’s already been unzip the second time is faster.

I futzed around with New-Module but it was tricky to load everything correctly when there are a lot of dependencies that aren’t recognized by PowerShell (like HTML\CSS files).


#3

Ok thanks,
Is it possible to delete some files, that are not needed in that case? Maybe something dedicated to iis? UD light ?


#4

The web.config and UniversalDashboard.Server.exe are the only thing related to IIS.

You can delete the entire netstandard2.0 folder if you are planning to run under Windows PowerShell.


#5

Ok nice, that helps a lot