PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Add an option in File Explorer to enable Preview of PowerShell files

Open doctordns opened this issue 2 years ago • 4 comments

Description of the new feature / enhancement

I'd like you to add an option to view (or not) PowerShell files in Filer Explorer.

Proposed layout:

>_ Enable PowerShell preview (.ps1, .psm1, .psd1, .ps1xml, .pssc, .psrc, .cdxml)

Scenario when this would be used?

IT Pros using PowerShell would appreciate a fast way to turn this on.

YES: I know know you can do it manually (https://tfl09.blogspot.com/2021/12/viewing-powershell-files-in-preview.html) which should give you a heads up on the reg keys you need to set to achieve this!

Supporting information

https://tfl09.blogspot.com/2021/12/viewing-powershell-files-in-preview.html

doctordns avatar May 09 '22 16:05 doctordns

I am not sure if this is the place - if not, please let me know. I realize it is slightly off topic - didn't seem like this deserved a new topic.

There are a lot of file extensions which are not registered and do not show on preview. I would suggest an option to view these as text by default. Maybe an additional option would be to detect files with non-ASCII content and preview them as a hex dump.

Possible Hex Dump Format: AAAAAAAA HH HH HH HH HH HH HH HH - HH HH HH HH HH HH HH HH %%%%%%%% - %%%%%%%% A is the address in the file beginning with 00000000 HH is the Hex Code for the byte value % is the ASCII character for the corresponding Byte "." for non printable ASCII character

I know this does not take into consideration unicode. As a developer, I have a .reg file for adding "PerceivedType"="Text" to about 50 different file types and am constantly having to add more to this list and then run it to update the registry.

PeterHouseJr avatar May 09 '22 19:05 PeterHouseJr

I love the idea - but that would really be a separate issue. I'd love the developers to fix this for PowerShell...

doctordns avatar May 09 '22 19:05 doctordns

Hey @Aaron-Junker - looks like you assigned this one to yourself - is this something you want to pick up or add to the backlog? I'll remove the needs triage label if so and put it in the backlog.

joadoumie avatar Apr 26 '24 19:04 joadoumie

Hey @Aaron-Junker - looks like you assigned this one to yourself - is this something you want to pick up or add to the backlog? I'll remove the needs triage label if so and put it in the backlog.

I will pick this up soon

Aaron-Junker avatar Apr 26 '24 21:04 Aaron-Junker