How to fix the PowerGui error “index was out of range. Must be non-negative…”

I was getting this error whenever I tried to open a PowerShell script by double clicking it. PowerGui is my default PowerShell editor.

The workaround is to empty out the PowerGUI configuration settings and data for the user account under which it fails to start. Making a backup is probably wise.

Navigate to each path below and delete the PowerGui folder.

  • %USERPROFILE%AppDataRoamingQuest Software
  • %USERPROFILE%AppDataLocalQuest Software
You may have to empty your recycle bin as well.