Powershell fails when called from .bat file due to UnauthorizedAccess

See build at : https://travis-ci.org/github/openziti/desktop-edge-win/builds/737392266

This is a well-known powershell issue. I have two fallback plans, call the powershell script from travis - or convert this bat file to a ps1 to get into the powershell context but I would argue that calling powershell from a bat file like this should be reasonable.

The corresponding line triggering this issue is here.

File C:\Users\travis\gopath\src\github.com\openziti\desktop-edge-win\update-versions.ps1 cannot be loaded. The file 
C:\Users\travis\gopath\src\github.com\openziti\desktop-edge-win\update-versions.ps1 is not digitally signed. You 
cannot run this script on the current system. For more information about running scripts and setting execution policy, 
see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
    + CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnauthorizedAccess

Found my own solution - in the install phase I could add:

  - PowerShell -Command 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned'
2 Likes