Code changes to APIs are not saved

Product: PowerShell Universal
Version: 5.0.0

I have just installed the release version of PowerShell Universal 5 (5.0.0).

When I create a new API endpoint and specify a path (e.g. D:\PSU\API\Test\Test.ps1), edit the API code (in the web UI) and save, the changes are not saved. The file is created in the correct location, but it’s empty.

If I don’t specify a path, the code is saved in endpoints.ps1 as expected.

If I edit the file outside of the web UI and then try to open the code in the code editor, the code window is empty, and when I look at the file, it’s also empty.

I did not have this issue in PowerShell Universal 4.

Both endpoints.ps1 and my custom path exists in the same folder (D:\PSU). When I monitor file access with ProcessExplorer, I can see that PSU successfully creates the file with content, but then continues to overwrite the file with no content.

I installed the nightly build (5.0.1) and the issue disappeared.

2 Likes