The HASS.agent appears to only be able to use the "system" powershell version. Calling functions that are available in newer versions of power-shell, even if in the system path, will not work and gives various syntax errors. Calling "pwsh <script>" inside the application produces an error saying "Set-PSReadLineOption: ", "The predictive suggestion feature cannot be enabled because the console output doesn't support virtual terminal".
It would be nice if we could select which powershell would be used, or some way to override the default system one.