Error when i click submit in user interface app

i get the error “Unable to serialize instance of ‘System.IO.DirectoryInfo’.” after clicking submit in a user interface app. How do i get rid of this and see a more user friendly message after they click submit?

Product: PowerShell Universal
Version: 4.2.14

seems like its when it’s creating a non-existing folder. i tried using new item and the .NET method and both cause the error