I recently discovered the possibility to bind a parameter by a custom type name. The common approach seems to be using [PSCustomObject] as parameter type if you don’t use classes.
Just for clarify a little example:
My questions here are:
- Does this scenario of using PSTypeName for parameter binding respect the best practice and common used style guide?
- It seems to fill the gap for using the PSCustomObjects and still be able to bind it properly. So why is this so rare to find?
- Is this a newer feature? Was this introduced in v4 or v5?
Yes, this is a repost from PowerShellPracticeAndStyle #107. - But my purpose is to expand scope into this awesome community :)