src/modules/previewpane/MarkdownPreviewHandler/TestFiles/GPO-TESTING.md
Run these commands in an elevated (Administrator) command prompt:
REM Force-enable local images (toggle locked ON in Settings UI):
reg add "HKLM\SOFTWARE\Policies\PowerToys" /v MarkdownAllowLocalImages /t REG_DWORD /d 1 /f
REM Force-disable local images (toggle locked OFF in Settings UI):
reg add "HKLM\SOFTWARE\Policies\PowerToys" /v MarkdownAllowLocalImages /t REG_DWORD /d 0 /f
REM Remove policy (user controls the setting):
reg delete "HKLM\SOFTWARE\Policies\PowerToys" /v MarkdownAllowLocalImages /f
After changing the registry value, restart PowerToys for the setting to take effect.
src/gpo/assets/PowerToys.admx to C:\Windows\PolicyDefinitions\src/gpo/assets/en-US/PowerToys.adml to C:\Windows\PolicyDefinitions\en-US\gpedit.msc| GPO State | User Setting | Images Shown? | Settings UI Toggle | Info Bar |
|---|---|---|---|---|
| Not configured | OFF | No | Editable, OFF | "Some pictures have been blocked..." |
| Not configured | ON | Local/UNC only | Editable, ON | "Some online images have been blocked..." (if remote images in file) |
| Enabled | (ignored) | Local/UNC only | Locked ON (grayed out) | "Some online images have been blocked..." (if remote images in file) |
| Disabled | (ignored) | No | Locked OFF (grayed out) | "Some pictures have been blocked..." |
Set GPO to "Enabled" via registry
Open PowerToys Settings > File Explorer > Markdown
Verify the "Show local images" toggle is ON and grayed out (cannot be changed)
Preview test-local-images.md in File Explorer
Verify local image renders, remote image is blocked with info bar
Set GPO to "Disabled" via registry
Restart PowerToys
Verify the toggle is OFF and grayed out
Preview the same file
Verify all images are blocked
Remove the GPO registry value
Restart PowerToys
Verify the toggle is editable again