Chapter 14. PowerShell type formatting
Type formatting is used to define how a .NET type will be displayed on the PowerShell command line or host. Without the use of formatting a large number of .NET types would prove difficult to read. This chapter focuses on defining a custom formatting file for the PrintSystemJobInfo class. This class defines the print jobs that are in progress on local and remote print servers. The following script outputs all the print jobs on the local machine:
The script creates a new PrintServer object, iterates over the print queues on the system, and then returns the print jobs for each of the print queues. Running the script yields output similar to what’s shown here: