Just figured out this annoying issue I have seen come up many times while saving Powershell script workflows.
For some reason, I would get management pack validation exceptions when trying to save workflows in the Authoring Console.
The only workaround was to rename the variable in my script.
This happened on several different occasions. Even though context around the exception revealed that the MP validator was apparently expecting a $Data variable notation, it simply wasn’t apparent to me why my script variable would always cause failures.
I finally put 2 and 2 together, and realize that this only happened when the Powershell script contained variables like $DatabaseServer, $DatabaseName or $Dataset, just to name a few examples.
Lesson learned – Do not name Powershell variables $Data*.