And that works well during deployment.
However if that machine restarts I would like to make sure the process is started.
As far as I can see I cannot runt a deployment step on every windows startup.
So instead I planned on using windows schedule to run a powershell script.
And during deployment I generate this powershell script to point to the last extracted path.
But this is where I run in to problems, the extracted path does not contain x.runtimeconfig.json despite it being part of the nuget package, and without that I cannot run the executable.
Setting up a scheduled task for this sounds like the best approach to me
The approach I’d take is to have your scheduled task to always look for a persistent place(*) that holds the latest path of your x.runtimeconfig.json so it can be used with your start-process cmdlet. Then, on each deployment you’d be updating the value of your persistent place (*) with the last extracted path.
(*) This could be:
A .config file
An environment variable
A Registry entry
Let me know if the above works/makes sense for your scenario.