Skip to content

write-HostItemDecorator is un-necessarily wrapped #11

@plastikfan

Description

@plastikfan

write-HostItemDecorator can easily be turned into a script block obviating the need for the wrapper object. I discovered this as a result of perusing as issue on PSScriptAnalyzer (PowerShell/PSScriptAnalyzer#711 (comment)); a comment by @rjmholt illustrates how to do this:

We can use this technique for passing write-HostItemDecorator as a parameter to invoke-ForeachFile, without powershell mistaing it for in an place invocation of the function.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions