You need uvx installed for these to work.
Run the command lines in PowerShell to install.
Each registration is shown first in a readable form and then as the generated one-liner to run. After editing a pretty-printed block, run uv run update_oneliners.py to replace both one-liners in-place. Do not edit the generated blocks directly.
The PowerShell window closes automatically on success. If uvx or clipboard handling fails, it stays open and displays the error until you press Enter.
$key='Registry::HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.ics\shell\CopyAsMarkdown';
New-Item $key -Force | Out-Null;
Set-ItemProperty $key -Name '(default)' -Value 'Copy as Markdown';
New-Item "$key\command" -Force | Out-Null;
$cmd='powershell.exe -NoProfile -Command "& {
$ErrorActionPreference = ''Stop'';
try {
$env:PYTHONIOENCODING = ''utf-8'';
$OutputEncoding = [System.Text.UTF8Encoding]::new();
$content = & uvx icalendar ''%1'';
if ($LASTEXITCODE -ne 0) {
throw (''uvx exited with code {0}'' -f $LASTEXITCODE)
};
Set-Clipboard -Value ($content -join [Environment]::NewLine)
} catch {
Write-Host '''';
Write-Host ''Copy as Markdown failed:'' -ForegroundColor Red;
Write-Host $_ -ForegroundColor Red;
Read-Host ''Press Enter to close''
}
}"';
Set-ItemProperty "$key\command" -Name '(default)' -Value $cmd$key='Registry::HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.ics\shell\CopyAsMarkdown'; New-Item $key -Force | Out-Null; Set-ItemProperty $key -Name '(default)' -Value 'Copy as Markdown'; New-Item "$key\command" -Force | Out-Null; $cmd='powershell.exe -NoProfile -Command "& { $ErrorActionPreference = ''Stop''; try { $env:PYTHONIOENCODING = ''utf-8''; $OutputEncoding = [System.Text.UTF8Encoding]::new(); $content = & uvx icalendar ''%1''; if ($LASTEXITCODE -ne 0) { throw (''uvx exited with code {0}'' -f $LASTEXITCODE) }; Set-Clipboard -Value ($content -join [Environment]::NewLine) } catch { Write-Host ''''; Write-Host ''Copy as Markdown failed:'' -ForegroundColor Red; Write-Host $_ -ForegroundColor Red; Read-Host ''Press Enter to close'' } }"'; Set-ItemProperty "$key\command" -Name '(default)' -Value $cmd$key='Registry::HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.eml\shell\CopyAsMarkdown';
New-Item $key -Force | Out-Null;
Set-ItemProperty $key -Name '(default)' -Value 'Copy as Markdown';
New-Item "$key\command" -Force | Out-Null;
$cmd='powershell.exe -WindowStyle Hidden -NoProfile -Command "& uvx
--from eml-to-md
--with pyperclip
python -c
''import sys, eml_to_md, pyperclip;
pyperclip.copy(eml_to_md.convert(sys.argv[1]))''
''%1''"';
Set-ItemProperty "$key\command" -Name '(default)' -Value $cmd$key='Registry::HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.eml\shell\CopyAsMarkdown'; New-Item $key -Force | Out-Null; Set-ItemProperty $key -Name '(default)' -Value 'Copy as Markdown'; New-Item "$key\command" -Force | Out-Null; $cmd='powershell.exe -WindowStyle Hidden -NoProfile -Command "& uvx --from eml-to-md --with pyperclip python -c ''import sys, eml_to_md, pyperclip; pyperclip.copy(eml_to_md.convert(sys.argv[1]))'' ''%1''"'; Set-ItemProperty "$key\command" -Name '(default)' -Value $cmd