Managing PSStyle's File Extension Dictionary
Documentation on PowerShell's experimental PSANSIRenderingFileInfo feature is understandably limited at the moment. This experiment was added in PowerShell 7.2. This feature adds the $PSStyle.FileInfo member and enables coloring of specific file types. $PSStyle.FileInfo.Directory - Built-in member to specify color for directories $PSStyle.FileInfo.SymbolicLink - Built-in member to specify color for symbolic links $PSStyle.FileInfo.Executable - Built-in member to specify color for executables. $PSStyle.FileInfo.Extension - Use this member to define colors for different file extensions. The Extension member pre-includes extensions for archive and PowerShell files. Using Experimental Features in PowerShell | Microsoft Docs Methods After some trial-and-error in a console, I found several methods offered by [System.Management.Automation.PSStyle+FileExtensionDictionary] that stand out: Add() Creates an extension with an associated decoration and appends it to the dic...