Viewing other types of file containing simple text in Windows

1 min read · Updated 18 December 2021

Did this guide help you? You can support me by subscribing to the channel, sharing it, disabling your ad blocker or making a donation. Thank you!

Hello,

It is possible to view other types of files containing simple text such as .ps1, .psm1, .psd1, .twig, .gcode… in Windows File Explorer.

PowerShell code

# Remember to change the extension in the commands, '.ps1' and '.twig' in the examples.
# Settings for the current user
Set-ItemProperty HKCU:\Software\Classes\.ps1 -Name PerceivedType -Value text
# If the key does not exist for the extension, it must be created
New-Item HKCU:\SoftwareClasses\ -Name .ps1
# System-wide setting, requires administrator rights
Set-ItemProperty Registry::HKEY_CLASSES_ROOT\.twig -Name PerceivedType -Value text
# If the key does not exist for the extension, it must be created
New-Item Registry::HKEY_CLASSES_ROOT\ -Name .twig

Video : Viewing other types of file containing simple text in Windows

Play

Related links