-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Description
Summary of the new feature/enhancement
Currently powershell is unable to implement Composition Over Inheritance because of a lack of support for custom "interfaces"
There is a way to get it to work, but it only works when running the code by hand, not in automated scripts
Proposed technical implementation details (optional)
The issue with the workaround boils down to a problem in the parser error: InterfaceNameExpected
It fails to recognize that using Add-Type will add types, instead it incorrectly assumes the given type will not be available
I think we should either allow a keyword to override this error, or educate the parser on the usage of Add-Type
Examples
I have included 3 examples:
A single file script that fails when run as a whole, but works if you manually run it line by line
A split that works, but is forced to have an incorrect dependency tree
A split that fails, because it's using a correct dependency tree
Note: The splits use dot sourcing, you'll need to adjust the paths to the appropriate folders on your computer
Fail - Single File.zip
Success - Bad Dependancy layout.zip
Fail - Good Dependency Layout.zip