What is the idea of ​​using try with `catch {throw}`?

In PowerShell v2.0, if I do this:

gc function:\mkdir 

I get code that contains this:

 try { $steppablePipeline.End() } catch { throw } 

What is the idea of try/catch/throw here?

+4
source share
1 answer

When you create a proxy function, it is a function that is a wrapper around another (or cmdlet), with built-in tools (see here for an example), the generated code includes this code. It is intended for easy modification, but if the generated code is enough, then why change it?

+1
source

All Articles