Losing all my dashboard page code .... again

Hello,

I don’t know what I’m doing wrong but I can’t tell how many time I’m losing my code when editing a dashboard page.

Already made an issue and seems that was fixed in 5.5.1 but it’s not the case.

I’ve created a new page on a dashboard through the App interface then I’ve worked 2 hours on the code of that page directly on the GUI but in the Settings > Files > Dashboard > Page interface (I don’t work anymore in the Apps > Page interface has I had issues before, with losing code).

I saved every 5 min, working and finished the page. I had the bad idea to modify the title through the App > Pages > Setting. Saved and boom, all the code vanished…
I get back the Settings > FIles > Dashboard > Page. Nothing, just “Hello, world !”

I’ve already disabled already “Format On Save”, “Auto Reload” and “PSScriptAnalyzer”

Nothing seems to fix that bug

Product: PowerShell Universal
Version: 5.5.2

I have seen this before as well. I found a slightly different version recently that I opened an issue for: Script gets deleted if there is an error when moving script · Issue #4765 · ironmansoftware/powershell-universal

I found that when I moved a script, if it gave an error, the script would actually get moved, but PSU wouldn’t recognize that and delete it if the config was reloaded and it wasn’t where it thought it should be. I suspect something similar is happening here. I think in the past it had to do with renaming the script.

It might be worth looking into tracking your changes with Git and syncing them to GitHub. Anytime you make a change, commit it to Git. Then if something goes wrong, you can restore it.

1 Like