Chapter 12. Creating custom format views
We’re getting back to the script that we left off with in chapter 10, before our short diversion into the world of debugging. One thing we didn’t like about that script was its output. Some folks would be tempted to put commands right into the script to fix that, but we know better. Remember: A tool should either create input for another tool, do something, or format output from another tool. Our tool is already doing something, so we can’t have it start messing around with formatting the output as well. Instead, we’ll get PowerShell to do that for us by creating a custom view.
12.1. The anatomy of a view
PowerShell ships with a number of views, all of which are contained in .format.ps1xml files that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access