Powershell-Change thumbnail colour of .stl files

G_Man 0 Reputation points
2026-10-14T21:36:19.94+00:00

In Powershell, how to change thumbnail colour of .stl files

Windows for home | Other | Files, folders, and storage
0 comments No comments

1 answer

Sort by: Most helpful
  1. Emma1-N 13,700 Reputation points Microsoft External Staff Moderator
    2026-10-15T03:35:45.7733333+00:00

    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.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.