mushanshitiancai / vscode-paste-image

paste image from clipboard to markdown/asciidoc directly!
MIT License
424 stars 129 forks source link

Windows inline ps1 when exec privilege restricted #85

Open hmalphettes opened 3 years ago

hmalphettes commented 3 years ago

In restricted windows machines, it is forbidden to specify a powershell execution policy and it is usually forbidden to execute an unsigned script.

Inlining the script as an encoded command avoids that problem. Note that the encoded command cannot be passed a parameter: so we need to place the value of the image path inside the script and generate it dynamically on every invocation.

bnii commented 2 years ago

thanks, just found this and it was very useful to me

hmalphettes commented 2 years ago

If one trusts things downloaded from the internet, here is my build of the plugin with this patch: https://github.com/hmalphettes/vscode-paste-image/releases/tag/1.0.4.inlinedps

The safer thing to do is of course to build it yourself or apply the patch on the installed plugin sources.