Skip to content

Instantly share code, notes, and snippets.

@sefgit
Last active May 27, 2024 17:26
Show Gist options
  • Save sefgit/803f1a288ef018894eb23695a8b53467 to your computer and use it in GitHub Desktop.
Save sefgit/803f1a288ef018894eb23695a8b53467 to your computer and use it in GitHub Desktop.
Scripts to unblock dlls
Get-ChildItem -Path . -Recurse -Filter *.dll -File -Name | Unblock-File
import subprocess
from glob import iglob
from os.path import dirname
workdir = dirname(__file__)
pattern = join(workdir, "**", "*.dll")
for file in iglob(pattern, recursive=True):
cmd = f'Unblock-File -Path "{file}"; Write-Output "{file} unblocked"'
subprocess.run(["powershell", "-Command", cmd])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment