PowerShell: Unable to find type when using PS 5 classes
As you’ve discovered, PowerShell refuses to run scripts that contains class definitions that reference then-unavailable (not-yet-loaded) types – the script-parsing stage fails. As of PSv5.1, even a using assembly statement at the top of a script does not help in this case, because in your case the type is referenced in the context of a … Read more