exceptionpowershellextension-methodsswallowed-exceptions

powershell call to extended property fails silently ( Added via Update-TypeData )


My questions are:


Solution

  • What I've been told from the PowerShell team is that exceptions from properties are always masked as properties are heavily used during formatting & output. Exceptions are not masked for ScriptMethod. While this is unfortunate from a debugging stand-point, properties in general should not be doing much more than getting & setting state. I'd also add that .NET devs don't expect a property get to throw.

    If you don't like this behavior feel free to submit an issue on the http://connect.microsoft.com site. I know at least one of the PowerShell devs doesn't like that the exception is always hidden i.e. even outside of formatting operations. Having some customer input on this could help the dev make a case for changing the behavior - at least when in strict mode.