Skip to content

Improved Errors, Bug Fixes, & A New Look

Compare
Choose a tag to compare
@patrickenfuego patrickenfuego released this 31 Dec 02:02
· 149 commits to main since this release

This release was about adding more polish to the script and doing some much-needed cleanup on large chunks of the old codebase.

What's New

Improved Errors & Error Handling

Continuing some work I started in the last release, I've completely overhauled error handling and error messages in this release. I removed pretty much all of the throw statements and replaced them with errors that are more meaningful and don't suck. Errors now look a lot cleaner in the console as well due to the way they are handled in the call stack, but a lot more information is available (but hidden, PowerShell 7 style) for those who wish to dig deeper.

The script now checks for the host PowerShell version, and throws differing errors depending on the situation. Some examples:

  • PowerShell 7 is not installed
  • PowerShell 7 is installed but a different host version is being run

Some errors that were previously terminating errors have been modified with re-input prompts as well, so the script will not automatically crash.

-ExitOnError Parameter

If you'd prefer that the script crashes instead of prompting for re-input, you can use this parameter. I had automation in mind with this, so the script won't get stuck on an input screen, but will exit instead and continue on with the next encode.

Imrpoved Console Output

Logic was added to automatically set the console foreground and background colors for better compatibility with the output color scheme (no more weird bright blue backgrounds with black & green text). A neat new banner was added, as well, and the window title will now display 'FFEncoder'. Sweet.