Téléverser les fichiers vers "/"
This commit is contained in:
1 parent
d0451c9f51
commit
11f99a588f
3 files changed
+124
-1
No files matched your search
@@ -0,0 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from setuphelpers import *
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
uninstallkey = []
|
||||
|
||||
|
||||
def _run(action):
|
||||
script = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'hardening.ps1')
|
||||
result = subprocess.run(['powershell.exe', '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-File', script, '-Action', action], capture_output=True, text=True)
|
||||
print(result.stdout)
|
||||
if result.stderr:
|
||||
print(result.stderr)
|
||||
if result.returncode != 0:
|
||||
raise Exception('Hardening %s failed with code %s' % (action, result.returncode))
|
||||
|
||||
|
||||
def install():
|
||||
_run('install')
|
||||
|
||||
|
||||
def audit():
|
||||
try:
|
||||
_run('audit')
|
||||
return 'OK'
|
||||
except Exception as exc:
|
||||
print(exc)
|
||||
return 'WARNING'
|
||||
|
||||
|
||||
def uninstall():
|
||||
_run('uninstall')
|
||||
Reference in new issue
Block a user