Welcome G_Man,
Thanks for reaching out to Microsoft Q&A Forum. I understand you would like to change the color associated with .stl files using PowerShell.
Could you confirm whether you want to change the color of the .stl filename displayed in PowerShell or the actual 3D thumbnail displayed in File Explorer? Also, which Windows version are you using?
In the meantime, you can try these steps:
1, If your goal is to change the color of .stl files when they are listed in PowerShell, first open PowerShell 7.
2, Check that $PSStyle is available:
- Run
$PSStyle.FileInfo - PowerShell 7 provides $PSStyle.FileInfo for controlling the coloring of FileInfo objects. about_ANSI_Terminals [about_ANSI_Terminals]
3, Assign a color to the .stl extension:
- Run
$PSStyle.FileInfo.Extension['.stl']`` ``=`` ``$PSStyle.Foreground.Cyan - You can replace Cyan with another supported foreground color.
4, Test the change:
- Browse to a folder containing .stl files.
- Run
Get-ChildItem - Check whether the .stl entries now appear in the selected color.
5, Please note that $PSStyle.FileInfo.Extension controls how file extensions are colored in compatible PowerShell terminal output. [about_ANSI_Terminals]
Looking forward to your update.