as i already wrote earlier, it’s possible to install PowerShell 7 on a Home Assistant instance, but it has multiple disadvantages to install it directly.
As i’m strong in PowerShell and able to do a lot of automations with it, i don’t want to miss PowerShell anymore.
Happily there is PowerShell Universal.
PowerShell Universal is a tool, you can run on a server as a service, which provide the ability to trigger PowerShell code through an API. So you can define your own API endpoints and let PowerShell code run based on your web request, post body or inputs you give during the API call.
PowerShell Universal is a commercial tool, but if you can live with a limited set of features, then there is a free license, which could be really interesting to be between Home Assistant and other third party which is more complicated to automate.
In my case, i have several third party tools, which were accessible through an API, but need pre-authentication and token-based-authentication and perhaps needs some extra queries and extra calculations in forehand. With PowerShell Universal, you can do that all in one script and present it to a simple API endpoint. I use it in the meantime with PowerShell 7 scripts, but if you want, you can use Windows PowerShell 5.1, too.