#PSTip Preview PowerShell script files in Windows Explorer Preview Pane
The Windows Explorer Preview Pane can display the contents of text files, graphics, and other file types without having to use external software.
To add new file types to preview, such as PowerShell scripts, run the following command:
PS> Set-ItemProperty Registry::HKEY_CLASSES_ROOT\.ps1 -Name PerceivedType -Value text
Here’s how it looks in regedit.exe after the value has been added.
Now navigate to your scripts folder and select a script file. If the preview pane is open and you don’t see the script content, turn preview off and then on (you can use the ALT+P shortcut twice) to force Explorer to read the Registry value. Now you should see its content displayed:
To enable preview for multiple extensions:
PS> Get-Item Registry::HKEY_CLASSES_ROOT\* -Include .ps1,.psm1,.psd1 | Set-ItemProperty -Name PerceivedType -Value textShare on: