All existing Scripts suddenly empty

Product: PowerShell Universal
Version: 5.4.1

Hello everyone,

Today, we experienced very strange behavior with PowerShell Universal. When executing a script with parameters, we noticed that it no longer recognized the cmdlets. Shortly thereafter, all scripts were in a state as if a new script had been created with just a name. All content was missing. All PowerShell files in ProgramData were essentially emptied. Has anyone here already had experience with how something like this can happen?

Thanks for your help

Another issue we noticed is that when creating a script through PSU, the “Name” field does not allow input and starts to shake.

I think this is fixed in 5.4.2 from the changelog and another post I saw

Platform

  • Fixed an execution policy issue with vaults.ps1
  • Fixed an errant log message in standard out (#4500)
  • Fixed an issue where scripts contents could be overwritten with the default value

^ 5.4.2 Changelog

Ive noticed this a couple of times, and cancelling and reopening the add has given me a stable window - I thought it ws just me!

1 Like

@TriggerAu thanks for your fast reply. We updated PSU immediately

1 Like

This happened to me yesterday, was also running 5.4.1. All my scripts disappeared without a trace, including the entirety of the Repository folder. Luckily I was able to restore the backup of the scripts, but after updating PSU to the latest version and verifying the scripts are in the correct place and have the correct contents, PSU is still reporting all scripts have the following contents:
# Script contents

Still trying to figure out how to get PSU to rescan the local PowerShell files and grab the contents

It should rescan the files every time it starts up. You can also force a rescan by navigating to Settings \ Files and clicking the sync drop down. While you are in files, I would recommend checking to see what is in scripts.ps1 to ensure the files are listed as expected.