Search This Blog

Saturday, July 16, 2022

PowerShell: Preview content in explorer

After writing a few scripts and filling my "test folder" with a bunch of one-liners I realized Windows 11 wouldn't let me preview the scripts in the preview pane of the file explorer.

A quick Google search led me to this site in which the author talks about editing the registry.

Basically I used this line of code, as an administrator, in PowerShell:

New-ItemProperty -path "registry::HKEY_CLASSES_ROOT\.vbs" -name PerceivedType -PropertyType String -Value 'text'

Where .vbs could be exchanged for .ps1, which is the PowerShell script file extension.

For .ps1, .psd1 and .psm1 I didn't have to elevate my prompt.

No comments:

Post a Comment